|
34 | 34 | import software.amazon.smithy.rulesengine.language.syntax.rule.Condition;
|
35 | 35 | import software.amazon.smithy.rulesengine.language.syntax.rule.EndpointRule;
|
36 | 36 | import software.amazon.smithy.rulesengine.language.syntax.rule.ErrorRule;
|
| 37 | +import software.amazon.smithy.rulesengine.language.syntax.rule.NoMatchRule; |
37 | 38 | import software.amazon.smithy.rulesengine.language.syntax.rule.Rule;
|
38 | 39 | import software.amazon.smithy.rulesengine.language.syntax.rule.TreeRule;
|
39 | 40 | import software.amazon.smithy.rulesengine.logic.ConditionReference;
|
@@ -66,7 +67,7 @@ public final class CfgBuilder {
|
66 | 67 | private int convergenceNodesCreated = 0;
|
67 | 68 | private int phiVariableCounter = 0;
|
68 | 69 |
|
69 |
| - private String version = "1.1"; |
| 70 | + private String version; |
70 | 71 |
|
71 | 72 | public CfgBuilder(EndpointRuleSet ruleSet) {
|
72 | 73 | // Apply SSA transform to ensure globally unique variable names
|
@@ -297,9 +298,10 @@ private CfgNode buildConvergenceNode(
|
297 | 298 | Condition coalesceCondition = createCoalesceCondition(phiVar, versions);
|
298 | 299 | ConditionReference condRef = new ConditionReference(coalesceCondition, false);
|
299 | 300 |
|
300 |
| - // Use terminal (no match) as false branch to prevent BDD optimization |
301 |
| - // The coalesce always succeeds, so we never take the false branch |
302 |
| - resultNode = new ConditionNode(condRef, resultNode, ResultNode.terminal()); |
| 301 | + // Use NO_MATCH as false branch since coalesce should always succeed |
| 302 | + // This ensures we get a valid result index instead of null that would result from FALSE. |
| 303 | + CfgNode noMatch = createResult(NoMatchRule.INSTANCE); |
| 304 | + resultNode = new ConditionNode(condRef, resultNode, noMatch); |
303 | 305 |
|
304 | 306 | // Log with deterministic ordering
|
305 | 307 | LOGGER.fine(() -> {
|
|
0 commit comments