diff options
Diffstat (limited to 'BCT/BytecodeTranslator/StatementTraverser.cs')
-rw-r--r-- | BCT/BytecodeTranslator/StatementTraverser.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/BCT/BytecodeTranslator/StatementTraverser.cs b/BCT/BytecodeTranslator/StatementTraverser.cs index a062fca1..81a2c4e8 100644 --- a/BCT/BytecodeTranslator/StatementTraverser.cs +++ b/BCT/BytecodeTranslator/StatementTraverser.cs @@ -33,6 +33,7 @@ namespace BytecodeTranslator public readonly Bpl.StmtListBuilder StmtBuilder = new Bpl.StmtListBuilder();
private bool contractContext;
+ internal readonly Stack<Bpl.Expr> operandStack = new Stack<Bpl.Expr>();
#region Constructors
public StatementTraverser(Sink sink, PdbReader/*?*/ pdbReader, bool contractContext) {
@@ -164,6 +165,20 @@ namespace BytecodeTranslator return;
}
+ public override void Visit(IPushStatement pushStatement) {
+ var tok = pushStatement.Token();
+ var val = pushStatement.ValueToPush;
+ var dup = val as IDupValue;
+ Bpl.Expr e;
+ if (dup != null) {
+ e = this.operandStack.Peek();
+ } else {
+ e = ExpressionFor(val);
+ }
+ this.operandStack.Push(e);
+ return;
+ }
+
/// <summary>
///
/// </summary>
|