From 71cdfec9a9eae42bd999eccdc9277907ed04c557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A4ll=C3=A9n?= Date: Mon, 2 Sep 2024 14:29:10 +0200 Subject: [PATCH] Enhancement: allow RtlBranch to go to arbitrary destination. --- src/Core/Rtl/RtlBranch.cs | 2 +- src/Core/Rtl/RtlEmitter.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Core/Rtl/RtlBranch.cs b/src/Core/Rtl/RtlBranch.cs index 0c40f1b3b9..8e3a13c558 100644 --- a/src/Core/Rtl/RtlBranch.cs +++ b/src/Core/Rtl/RtlBranch.cs @@ -25,7 +25,7 @@ namespace Reko.Core.Rtl { public sealed class RtlBranch : RtlTransfer { - public RtlBranch(Expression condition, Address target, InstrClass rtlClass) + public RtlBranch(Expression condition, Expression target, InstrClass rtlClass) : base(target, rtlClass) { this.Condition = condition; diff --git a/src/Core/Rtl/RtlEmitter.cs b/src/Core/Rtl/RtlEmitter.cs index ef77500d3b..02f60d5070 100644 --- a/src/Core/Rtl/RtlEmitter.cs +++ b/src/Core/Rtl/RtlEmitter.cs @@ -91,7 +91,7 @@ public RtlEmitter Assign(Expression dst, int src) /// Control goes to this address if condition is true /// Describes details the branch instruction /// A reference to this RtlEmitter. - public RtlEmitter Branch(Expression condition, Address target, InstrClass rtlClass) + public RtlEmitter Branch(Expression condition, Expression target, InstrClass rtlClass) { Instructions.Add(new RtlBranch(condition, target, rtlClass)); return this; @@ -104,7 +104,7 @@ public RtlEmitter Branch(Expression condition, Address target, InstrClass rtlCla /// Boolean expression /// Control goes to this address if condition is true /// A reference to this RtlEmitter. - public RtlEmitter Branch(Expression condition, Address target) + public RtlEmitter Branch(Expression condition, Expression target) { Instructions.Add(new RtlBranch(condition, target, InstrClass.ConditionalTransfer)); return this;