A better but still temporary fix for bug #467035
[fw/sdcc] / src / SDCC.y
index d6217c53507e566b6ee1df511debc642addcba9a..ce8a014b85748c7b6ed1e8d68fcbcddcaf50877d 100644 (file)
@@ -756,11 +756,11 @@ struct_declaration
               if (!sym->type) {
                   sym->type = copyLinkChain($1);
                   sym->etype = getSpec(sym->type);
-                  /* make sure the type is complete and sane */
-                  checkTypeSanity(sym->etype, sym->name);
               }
               else
                   addDecl (sym,0,cloneSpec($1));              
+              /* make sure the type is complete and sane */
+              checkTypeSanity(sym->etype, sym->name);
           }
            $$ = $2;
        }
@@ -1135,14 +1135,15 @@ statement
    | jump_statement
    | INLINEASM  ';'      {
                             ast *ex = newNode(INLINEASM,NULL,NULL);
-                           ex->values.inlineasm = Safe_alloc(strlen($1)+1);
+                           ex->values.inlineasm = malloc(strlen($1)+1);
                            strcpy(ex->values.inlineasm,$1);                        
                            $$ = ex;
-                         }   
+                         } 
    ;
 
 labeled_statement
-   : identifier ':' statement          {  $$ = createLabel($1,$3);  }   
+//   : identifier ':' statement          {  $$ = createLabel($1,$3);  }   
+   : identifier ':'                    {  $$ = createLabel($1,NULL);  }   
    | CASE constant_expr ':' statement  {  $$ = createCase(STACK_PEEK(swStk),$2,$4); }
    | DEFAULT ':' statement             {  $$ = createDefault(STACK_PEEK(swStk),$3); }
    ;