Skip to content

Commit

Permalink
Enhancement: allow RtlBranch to go to arbitrary destination.
Browse files Browse the repository at this point in the history
  • Loading branch information
uxmal committed Sep 2, 2024
1 parent 4a11976 commit 71cdfec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Core/Rtl/RtlBranch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Rtl/RtlEmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public RtlEmitter Assign(Expression dst, int src)
/// <param name="target">Control goes to this address if condition is true</param>
/// <param name="rtlClass">Describes details the branch instruction</param>
/// <returns>A reference to this RtlEmitter.</returns>
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;
Expand All @@ -104,7 +104,7 @@ public RtlEmitter Branch(Expression condition, Address target, InstrClass rtlCla
/// <param name="condition">Boolean expression</param>
/// <param name="target">Control goes to this address if condition is true</param>
/// <returns>A reference to this RtlEmitter.</returns>
public RtlEmitter Branch(Expression condition, Address target)
public RtlEmitter Branch(Expression condition, Expression target)
{
Instructions.Add(new RtlBranch(condition, target, InstrClass.ConditionalTransfer));
return this;
Expand Down

0 comments on commit 71cdfec

Please sign in to comment.