Fix access violation on struct declaration and add an include
authorjbess <jbess@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 9 Jun 2001 20:26:45 +0000 (20:26 +0000)
committerjbess <jbess@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 9 Jun 2001 20:26:45 +0000 (20:26 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@875 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.h
src/SDCCsymt.c

index dc1b6e65f7c71766558f2ecb5b4f54495f651ad1..c469be9f2bee35867745d7c4bc0a6dac008dbdda 100644 (file)
@@ -29,6 +29,7 @@
 #include "SDCCsymt.h"
 #include "SDCCval.h"
 #include "SDCCset.h"
+#include "SDCCmem.h"
 
 #define  EX_OP       0
 #define  EX_VALUE    1
index 93ef1d86ea2c255b9ad37c67131380c517d5df7d..07b39065482ad52a1a113c45d9a89debf013ed6f 100644 (file)
@@ -103,7 +103,8 @@ addSym (bucket ** stab,
   int i;                       /* index into the hash Table */
   bucket *bp;                  /* temp bucket    *         */
 
-  checkTypeSanity(((symbol *)sym)->etype, sname);
+  /* Make sure sym is a symbol and not a structdef */
+  if (StructTab!=stab) checkTypeSanity(((symbol *)sym)->etype, sname);
 
   /* the symbols are always added at the head of the list  */
   i = hashKey (sname);