Browse Source

Fixed an issue reported by fuzzy test.

Marco Bambini 8 years ago
parent
commit
1600d87c65
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/compiler/gravity_semacheck2.c

+ 2 - 0
src/compiler/gravity_semacheck2.c

@@ -823,7 +823,9 @@ static void visit_class_decl (gvisitor_t *self, gnode_class_decl_t *node) {
 	
 	
 	// check superclass
 	// check superclass
 	if (node->superclass) {
 	if (node->superclass) {
+        // get super class identifier and reset the field (so in case of error it cannot be accessed)
 		gnode_identifier_expr_t *id = (gnode_identifier_expr_t *)node->superclass;
 		gnode_identifier_expr_t *id = (gnode_identifier_expr_t *)node->superclass;
+        node->superclass = NULL;
         
         
         // sanity check
         // sanity check
         if (gravity_core_class_from_name(id->value)) {
         if (gravity_core_class_from_name(id->value)) {