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: