Do not check for functions not returning a value if pc_rev is used.

The pc_rev intermediate code always returns a value, so the check is not needed, and (since the generated code does not jump to a return label) it can yield false positives.
This commit is contained in:
Stephen Heumann 2023-01-06 22:43:23 -06:00
parent cb6173557e
commit 4d1a8caf8a
1 changed files with 1 additions and 10 deletions

11
DAG.pas
View File

@ -5499,7 +5499,7 @@ case code^.opcode of
pc_bnt, pc_bnl, pc_cnv, pc_dec, pc_inc, pc_ind, pc_lbf, pc_lbu,
pc_ngi, pc_ngl, pc_ngr, pc_not, pc_stk, pc_cop, pc_cpo, pc_tl1,
pc_sro, pc_str, pc_fjp, pc_tjp, pc_xjp, pc_cup, pc_pop, pc_iil,
pc_ili, pc_idl, pc_ild, pc_bnq, pc_ngq, pc_rbo:
pc_ili, pc_idl, pc_ild, pc_bnq, pc_ngq, pc_rbo, pc_rev:
begin
code^.left := Pop;
Push(code);
@ -5534,15 +5534,6 @@ case code^.opcode of
Push(code);
end;
pc_rev:
begin
code^.left := Pop;
if (lint & lintReturn) <> 0 then
if fIsNoreturn or ((code^.optype <> cgVoid) and not doingMain) then
CheckReturn;
Push(code);
end;
pc_cnn:
begin
code^.opcode := pc_cnv;