Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…as the stack pointer.
  • Loading branch information...
commit 6d071307017d7923fa3b8dab20cc84feb51f3a0c 1 parent 990f92b
@mbebenita authored
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']
Please sign in to comment.
Something went wrong with that request. Please try again.