From: ceriel Date: Thu, 30 Jul 1987 09:20:59 +0000 (+0000) Subject: do better bad-pointer testing X-Git-Tag: release-5-5~3970 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=aa5ab511478177036829fc71c2c861fddc8b1b96;p=ack.git do better bad-pointer testing --- diff --git a/mach/mantra/int/deffile b/mach/mantra/int/deffile index d95394d9f..c45b43494 100644 --- a/mach/mantra/int/deffile +++ b/mach/mantra/int/deffile @@ -74,7 +74,9 @@ #endif #define adroff move.b (a3)+,(a5) ; move.b (a3)+,1(a5) #define claimstack tst.b -1024(sp) -#define locptr cmp.l sp,a0 ;\ +#define locptr cmp.l topstack,a0 ;\ + bhi 7f ;\ + cmp.l sp,a0 ;\ bcc 6f #define heaptr cmp.l hp,a0 ;\ bhi 7f ;\ diff --git a/mach/mantra/int/mloop0 b/mach/mantra/int/mloop0 index d64ad1219..9577cfecd 100644 --- a/mach/mantra/int/mloop0 +++ b/mach/mantra/int/mloop0 @@ -12,6 +12,7 @@ .define tblmax .define ml .define argc + .define topstack .sect .text .sect .rom .sect .data @@ -22,6 +23,7 @@ !--------------------------------------------------------------------------- _m_a_i_n: + move.l sp,topstack tst.l (sp)+ lea retarea,a5 !a5 POINTS AT RETURN AREA move.l nd,-(sp) !nd contains endbss @@ -507,6 +509,7 @@ maxcount: .space 4 tblmax: .space 4 globmax: .space 4 +topstack: .space 4 ml: .space 4 eb: .space 4 !EXPLICITELY REQUIRED eb, filb, curproc IN filb: .space 4 !THIS ORDER