From 1ae7f425c529437aa2bf63de878f7cdcc73ab4af Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 26 Aug 1999 21:13:58 +0000 Subject: [PATCH] * array elementsize of 0 doesn't crash anymore --- compiler/symdef.inc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/compiler/symdef.inc b/compiler/symdef.inc index b3caa4b184..34ac1c9ba7 100644 --- a/compiler/symdef.inc +++ b/compiler/symdef.inc @@ -1837,10 +1837,13 @@ {Tarraydef.size may never be called for an open array!} if highrange0) and + ( + (highrange-lowrange = $7fffffff) or + { () are needed around elesize-1 to avoid a possible + integer overflow for elesize=1 !! PM } + (($7fffffff div elesize + (elesize -1)) < (highrange - lowrange)) + ) Then Begin Message(sym_e_segment_too_large); size := 4 @@ -3715,7 +3718,10 @@ Const local_symtable_index : longint = $8001; { $Log$ - Revision 1.156 1999-08-17 13:58:56 michael + Revision 1.157 1999-08-26 21:13:58 peter + * array elementsize of 0 doesn't crash anymore + + Revision 1.156 1999/08/17 13:58:56 michael RTTI writing patch Revision 1.155 1999/08/16 16:26:04 pierre