From ec95f6dc98a3c78d995ac1719c36af9a80f718fd Mon Sep 17 00:00:00 2001 From: drmortalwombat <90205530+drmortalwombat@users.noreply.github.com> Date: Sun, 6 Oct 2024 13:59:06 +0200 Subject: [PATCH] Fix dynamic variable initalizer --- oscar64/InterCode.cpp | 2 +- oscar64/Parser.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index 3167274..edd2991 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -22877,7 +22877,7 @@ void InterCodeProcedure::Close(void) { GrowingTypeArray tstack(IT_NONE); - CheckFunc = !strcmp(mIdent->mString, "bar"); + CheckFunc = !strcmp(mIdent->mString, "foo"); CheckCase = false; mEntryBlock = mBlocks[0]; diff --git a/oscar64/Parser.cpp b/oscar64/Parser.cpp index d35e84e..d5615d8 100644 --- a/oscar64/Parser.cpp +++ b/oscar64/Parser.cpp @@ -6293,7 +6293,10 @@ Expression* Parser::ParseCastExpression(Expression* exp) else { Expression* cexp = new Expression(mScanner->mLocation, EX_CONSTRUCT); - cexp->mLeft = iexp; + Expression* lexp = new Expression(mScanner->mLocation, EX_LIST); + lexp->mLeft = iexp; + lexp->mRight = nullptr; + cexp->mLeft = lexp; cexp->mRight = nexp; cexp->mDecType = vdec->mBase;