diff --git a/compiler/avr/navrmat.pas b/compiler/avr/navrmat.pas index 20dd95ab6e..90f643c522 100644 --- a/compiler/avr/navrmat.pas +++ b/compiler/avr/navrmat.pas @@ -77,6 +77,7 @@ implementation skiplabel.increfs; location_reset_jump(location,truelabel,falselabel); cg.a_jmp_always(current_asmdata.CurrAsmList,falselabel); + cg.a_label(current_asmdata.CurrAsmList,skiplabel); cg.a_jmp_always(current_asmdata.CurrAsmList,truelabel); end else if (left.location.loc in [LOC_SUBSETREF,LOC_CSUBSETREF]) and diff --git a/tests/webtbs/tw33417.pp b/tests/webtbs/tw33417.pp index 10834a6257..abf163c4a4 100644 --- a/tests/webtbs/tw33417.pp +++ b/tests/webtbs/tw33417.pp @@ -5,27 +5,36 @@ type var gflags : tflags; + i : byte; -procedure p; +procedure p(pflags : tflags); var flags : tflags; begin flags:=gflags; if flags.bit5 then - halt(1); + i:=1; + if pflags.bit5 then + i:=1; if gflags.bit5 then - halt(1); + i:=1; if not flags.bit6 then - halt(1); + i:=1; + if not pflags.bit6 then + i:=1; if not gflags.bit6 then - halt(1); + i:=1; end; begin gflags.bit4:=false; gflags.bit5:=false; gflags.bit6:=true; - p; - writeln('ok'); + i:=0; + p(gflags); + if i<>0 then + halt(i) + else + writeln('ok'); end.