From 7f480846edccbd531601d3d722068f587286c05f Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 21 May 2024 09:53:37 -0400 Subject: [PATCH] DbgGetCurrentLocation failover --- IDEHelper/Compiler/BfIRCodeGen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfIRCodeGen.cpp b/IDEHelper/Compiler/BfIRCodeGen.cpp index c9a2974a..6f119a78 100644 --- a/IDEHelper/Compiler/BfIRCodeGen.cpp +++ b/IDEHelper/Compiler/BfIRCodeGen.cpp @@ -4897,7 +4897,10 @@ void BfIRCodeGen::HandleNextCmd() break; case BfIRCmd_DbgGetCurrentLocation: { - SetResult(curId, mIRBuilder->getCurrentDebugLocation()); + auto debugLoc = mIRBuilder->getCurrentDebugLocation(); + if (!debugLoc) + debugLoc = mDebugLoc; + SetResult(curId, debugLoc); } break; case BfIRCmd_DbgSetType: