From ff9a9ef2a3cd6cdae8a94d025d7213888f030017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csan=C3=A1d=20Telbisz?= Date: Fri, 20 Oct 2023 10:28:07 +0200 Subject: [PATCH] LBE pass fix -> do not skip procedures without error locations --- .../src/main/java/hu/bme/mit/theta/xcfa/passes/LbePass.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subprojects/xcfa/xcfa/src/main/java/hu/bme/mit/theta/xcfa/passes/LbePass.kt b/subprojects/xcfa/xcfa/src/main/java/hu/bme/mit/theta/xcfa/passes/LbePass.kt index 96cbd7832a..4f7e8b8f68 100644 --- a/subprojects/xcfa/xcfa/src/main/java/hu/bme/mit/theta/xcfa/passes/LbePass.kt +++ b/subprojects/xcfa/xcfa/src/main/java/hu/bme/mit/theta/xcfa/passes/LbePass.kt @@ -96,7 +96,7 @@ class LbePass(val parseContext: ParseContext) : ProcedurePass { * */ override fun run(builder: XcfaProcedureBuilder): XcfaProcedureBuilder { - if (level == LbeLevel.NO_LBE || builder.errorLoc.isEmpty) return builder + if (level == LbeLevel.NO_LBE) return builder if (level == LbeLevel.LBE_SEQ || level == LbeLevel.LBE_FULL && parseContext.multiThreading) { level = LbeLevel.LBE_LOCAL @@ -107,7 +107,9 @@ class LbePass(val parseContext: ParseContext) : ProcedurePass { this.builder = builder // Step 0 - builder.errorLoc.get().outgoingEdges.forEach(builder::removeEdge) + if (builder.errorLoc.isPresent) { + builder.errorLoc.get().outgoingEdges.forEach(builder::removeEdge) + } // Step 1 if (level == LbeLevel.LBE_LOCAL) {