From 4c3c1654fbf5ec4efd9b73602f4a7583a37fd7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Henrik=20Sk=C3=A5rstedt?= Date: Wed, 13 Mar 2019 12:08:21 -0700 Subject: [PATCH] Fix for -DLabel=value option --- x65.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x65.cpp b/x65.cpp index 4e3d201..2f27752 100644 --- a/x65.cpp +++ b/x65.cpp @@ -1443,6 +1443,7 @@ public: } void pop() { stack.pop_back(); currContext = stack.size() ? &stack[stack.size()-1] : nullptr; } bool has_work() { return currContext!=nullptr; } + bool empty() const { return stack.size() == 0; } }; // The state of the assembler @@ -3101,7 +3102,7 @@ void Asm::SetEvalCtxDefaults(struct EvalContext &etx) { etx.scope_depth = scope_depth; // scope depth for eval (must match current for scope_end_pc to eval) etx.relative_section = -1; // return can be relative to this section etx.file_ref = -1; // can access private label from this file or -1 - etx.rept_cnt = ReptCnt(); // current repeat counter + etx.rept_cnt = contextStack.empty() ? 0 : ReptCnt(); // current repeat counter } // Get a single token from a merlin expression