From f90403181358280cf4ea36b77e37217aad530b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csan=C3=A1d=20Telbisz?= <56129746+csanadtelbisz@users.noreply.github.com> Date: Fri, 20 Oct 2023 10:30:57 +0200 Subject: [PATCH] LBE pass fix Procedures without error locations are not skipped by LBE now --- .../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) {