소스 검색

+ added sanity check when resolving labels to ensure we don't get any jumps with
negative nesting depth

Nikolay Nikolov 3 년 전
부모
커밋
470e77a572
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      compiler/wasm32/cpupi.pas

+ 2 - 1
compiler/wasm32/cpupi.pas

@@ -516,7 +516,8 @@ implementation
                                (instr.oper[0]^.ref^.index<>NR_NO) or
                                (instr.oper[0]^.ref^.offset<>0) then
                               internalerror(2021102006);
-                            if instr.oper[0]^.ref^.symbol.nestingdepth<>-1 then
+                            if (instr.oper[0]^.ref^.symbol.nestingdepth<>-1) and
+                               (cur_nesting_depth>=instr.oper[0]^.ref^.symbol.nestingdepth) then
                               instr.loadconst(0,cur_nesting_depth-instr.oper[0]^.ref^.symbol.nestingdepth)
                             else
                               begin