From 4d1a8caf8ae842dd86def0a786d074c154732a1b Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Fri, 6 Jan 2023 22:43:23 -0600 Subject: [PATCH] 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. --- DAG.pas | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/DAG.pas b/DAG.pas index ca69f34..9da64f6 100644 --- a/DAG.pas +++ b/DAG.pas @@ -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;