Skip to content
Browse files

Make sure to never wipe out the type of already used expression such …

…as the stack pointer.
  • Loading branch information...
1 parent 990f92b commit 6d071307017d7923fa3b8dab20cc84feb51f3a0c @mbebenita committed Aug 19, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/util.js
View
8 src/util.js
@@ -12,6 +12,7 @@
const BinaryExpression = T.BinaryExpression;
const Literal = T.Literal;
const MemberExpression = T.MemberExpression;
+ const SequenceExpression = T.SequenceExpression;
function realign(expr, lalign) {
@@ -49,6 +50,7 @@
function dereference(address, byteOffset, ty, scope, loc) {
assert(scope);
+ address = copy(address, address.ty);
address = alignAddress(address, byteOffset, ty);
var expr;
if (ty instanceof Types.ArrayType) {
@@ -136,6 +138,12 @@
return node;
}
+ function copy(node, ty) {
+ node = new SequenceExpression([node], node.loc);
+ node.ty = ty;
+ return node;
+ }
+
var OptParser = (function () {
function OptParser(flatspec) {
// ['a', 'arg', default, 'help string']

0 comments on commit 6d07130

Please sign in to comment.
Something went wrong with that request. Please try again.