aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-07-18 10:13:21 -0700
committerrtk0c <[email protected]>2022-07-18 10:13:21 -0700
commita78bffc3a8ca4dfe6ca985223e38d28608184c52 (patch)
tree3d5a829d3c40a9614da7ef2512d4898dc438ee77 /source
parent8c2b1bd5bd85667a2ea24ec3aa85cbdd97f9ea1c (diff)
Changeset: 86 Fix generated enum metadata using the wrong identifiers (dangling pointer not fixed up after storing DeclEnum object into model)
Diffstat (limited to 'source')
-rw-r--r--source/20-codegen-compiler/main.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/20-codegen-compiler/main.cpp b/source/20-codegen-compiler/main.cpp
index af51900..782996b 100644
--- a/source/20-codegen-compiler/main.cpp
+++ b/source/20-codegen-compiler/main.cpp
@@ -938,13 +938,6 @@ void ParseInputFileAndGenerate(AppState& as, CodegenLexer& /*lexingState*/ ls, s
++idx;
}
- // if (po.currentEnum->generating) {
- // GenerateForEnum(po.headerOutput, po.sourceOutput, *po.currentEnum);
- // }
- if (po.currentEnum->generating) {
- as.enumsToRevisit.push_back(po.currentEnum);
- }
-
{
auto decl = as.runtimeModel->AddEnum(std::move(fullname), std::move(enumDecl));
// Fix pointers
@@ -952,6 +945,10 @@ void ParseInputFileAndGenerate(AppState& as, CodegenLexer& /*lexingState*/ ls, s
po.currentEnumBraceDepth = po.currentBraceDepth;
}
+ if (po.currentEnum->generating) {
+ as.enumsToRevisit.push_back(po.currentEnum);
+ }
+
// NOTE: we parse the whole enum at once (above code), the enum ends right here after the closing brace '}'
po.currentEnum = nullptr;
po.currentEnumBraceDepth = -1;