Fix code generation of enum value constants (this is a temporary fix - it will be followed by a code cleanup).
--- a/stage4/generate_c/generate_c_typedecl.cc Wed Nov 14 15:18:14 2012 +0000
+++ b/stage4/generate_c/generate_c_typedecl.cc Wed Nov 14 15:25:03 2012 +0000
@@ -321,7 +321,11 @@
debug_c::print(symbol);
ERROR;
}
- symbol->datatype->accept(*basedecl);
+ symbol_c *type_name = get_datatype_info_c::get_datatype_id(symbol->datatype);
+ if (NULL == type_name) {
+ ERROR_MSG("generate_c does not support anonymous enumerated data types.");
+ } else
+ type_name->accept(*basedecl);
}
s4o_incl.print("__");
symbol->value->accept(*basedecl);