工作正常一段时间后,我的代码在使用时开始引发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;
答案 0 :(得分:2)
SIGILL是遇到非法指令时发出的信号。如果您的问题中的代码导致SIGILL出现以下建议之一:
最终选项最有可能。如果您已经注销了数组的末尾,损坏了堆栈等,则可能会发生这种情况。
问题中的代码本身就显得非常无害。几乎可以肯定,代码中的缺陷位于其他地方。