拉撒路的SIGILL例外

时间:2015-04-28 14:02:44

标签: delphi exception lazarus fpc

工作正常一段时间后,我的代码在使用时开始引发SIGILL异常。 我不懂文档。 SIGILL例外在实际情况中意味着什么?

这是引发异常的代码,你能帮我指出原因吗?

function TfrmPascal.valorElemento(lin, col: integer): integer;
begin
     if lin < 0 then valorElemento:= 0 
     else if col < 0 then valorElemento:= 0
     else if (col=0) or (col = lin) then valorElemento:=1
     else valorElemento:= valorElemento(lin-1, col-1) + valorElemento(lin-1, col);
end; 

1 个答案:

答案 0 :(得分:2)

SIGILL是遇到非法指令时发出的信号。如果您的问题中的代码导致SIGILL出现以下建议之一:

  1. 您的可执行文件已损坏。
  2. 您的编译器发出了有缺陷的代码。
  3. 您正在尝试执行数据而非代码。
  4. 最终选项最有可能。如果您已经注销了数组的末尾,损坏了堆栈等,则可能会发生这种情况。

    问题中的代码本身就显得非常无害。几乎可以肯定,代码中的缺陷位于其他地方。