Skip to content

Commit de269f6

Browse files
committed
Fix GC issue
1 parent 0ea6e84 commit de269f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ScriptEngine.pas

+3-3
Original file line numberDiff line numberDiff line change
@@ -3716,7 +3716,7 @@ procedure TSEGarbageCollector.GC;
37163716
begin
37173717
VM := VMList[I];
37183718
P := @VM.Stack[0];
3719-
while P <= VM.StackPtr do
3719+
while P < VM.StackPtr do
37203720
begin
37213721
Mark(P);
37223722
Inc(P);
@@ -4449,7 +4449,6 @@ procedure TSEVM.Exec;
44494449
StackPtrLocal := Self.StackPtr;
44504450
BinaryPtrLocal := Self.BinaryPtr;
44514451
BinaryLocal := Self.Binaries[Self.BinaryPtr].Ptr(0);
4452-
GC.CheckForGC;
44534452

44544453
while True do
44554454
try
@@ -4934,6 +4933,7 @@ procedure TSEVM.Exec;
49344933
{$ifdef SE_COMPUTED_GOTO}labelCallScript{$else}opCallScript{$endif}:
49354934
begin
49364935
CallScript:
4936+
GC.CheckForGC;
49374937
ArgCount := Integer(BinaryLocal[CodePtrLocal + 2].VarPointer);
49384938
FuncScriptInfo := Self.Parent.FuncScriptList.Ptr(Integer(BinaryLocal[CodePtrLocal + 1].VarPointer));
49394939
Inc(Self.FramePtr);
@@ -4951,7 +4951,6 @@ procedure TSEVM.Exec;
49514951
end;
49524952
{$ifdef SE_COMPUTED_GOTO}labelPopFrame{$else}opPopFrame{$endif}:
49534953
begin
4954-
GC.CheckForGC;
49554954
CodePtrLocal := Self.FramePtr^.Code;
49564955
StackPtrLocal := Self.FramePtr^.Stack;
49574956
BinaryPtrLocal := Self.FramePtr^.Binary;
@@ -5276,6 +5275,7 @@ procedure TSEVM.Exec;
52765275
Self.CodePtr := CodePtrLocal;
52775276
Self.StackPtr := StackPtrLocal;
52785277
Self.BinaryPtr := BinaryPtrLocal;
5278+
GC.CheckForGC;
52795279
end;
52805280

52815281
constructor TEvilC.Create;

0 commit comments

Comments
 (0)