Skip to content

Commit ffbd42f

Browse files
author
outchy
committed
Mantis 5474: Integer overflow error using JCL Exception dialog.
Big projects have some glitches in stack frames, break the frame parsing loop in such cases to avoid overflows in arithmetics.
1 parent 893dd07 commit ffbd42f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jcl/source/windows/JclDebug.pas

+3
Original file line numberDiff line numberDiff line change
@@ -4933,6 +4933,9 @@ function TJclStackInfoList.NextStackFrame(var StackFrame: PStackFrame; var Stack
49334933
StackInfo.CallerAddr := StackFrameCallerAddr - CallInstructionSize
49344934
else
49354935
StackInfo.CallerAddr := StackFrameCallerAddr;
4936+
// the stack may be messed up in big projects, avoid overflow in arithmetics
4937+
if StackFrameCallerFrame < TJclAddr(StackFrame) then
4938+
Break;
49364939
StackInfo.DumpSize := StackFrameCallerFrame - TJclAddr(StackFrame);
49374940
StackInfo.ParamSize := (StackInfo.DumpSize - SizeOf(TStackFrame)) div 4;
49384941
if PStackFrame(StackFrame^.CallerFrame) = StackFrame then

0 commit comments

Comments
 (0)