瀏覽代碼

Fixed bug where hp1 object was used after being freed

J. Gareth "Curious Kit" Moreton 3 年之前
父節點
當前提交
190c77e863
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      compiler/x86/aoptx86.pas

+ 2 - 1
compiler/x86/aoptx86.pas

@@ -5943,9 +5943,10 @@ unit aoptx86;
            if taicpu(hp1).opsize=S_B then
            if taicpu(hp1).opsize=S_B then
              begin
              begin
                taicpu(p).loadoper(0, taicpu(hp1).oper[1]^);
                taicpu(p).loadoper(0, taicpu(hp1).oper[1]^);
-               RemoveInstruction(hp1);
                if taicpu(hp1).oper[1]^.typ = top_reg then
                if taicpu(hp1).oper[1]^.typ = top_reg then
                  AllocRegBetween(taicpu(hp1).oper[1]^.reg, p, hp2, UsedRegs);
                  AllocRegBetween(taicpu(hp1).oper[1]^.reg, p, hp2, UsedRegs);
+
+               RemoveInstruction(hp1);
              end
              end
            else
            else
              begin
              begin