Mail Archives: djgpp-workers/2003/02/11/05:19:30
Esa said:
> OK. Here's what I wrote during the weekend. Assuming that esp has
> already decremented to point to the newly allocated space, the possible
> overflow is detected thus:
>
> cmpl ___djgpp_stack_limit, %esp
> jge 0f
> movl $0f, ___djgpp_stack_overflow_eip
> jmp ___djgpp_stack_overflow_exit
> 0:
If we add __stklen into the formula (untested):
pushl %eax
movl ___djgpp_stack_limit, %eax
cmpl %eax, %esp
jb 0f
add __stklen, %eax ; Ooooh, we do actually add __stklen!
cmpl %eax, %esp
jb 1f
0:
popl %eax
movl $0f, ___djgpp_stack_flowing_wild_eip
jmp ___djgpp_stack_flowing_wild_exit
1:
popl %eax
we detect stack underflow or local variable of sizes > 2GiB as well.
Right,
MartinS
- Raw text -