Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
align varargs stack writes to the proper 4-byte boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Nov 22, 2013
1 parent e47b58a commit 6198caf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Transforms/NaCl/ExpandVarArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ static bool ExpandVarArgCall(InstType *Call, DataLayout *DL) {
DL->getTypeAllocSize((*Iter)->getType()->getPointerElementType()),
/* Align= */ 1);
} else {
CopyDebug(new StoreInst(*Iter, Ptr, Call), Call);
StoreInst *S = new StoreInst(*Iter, Ptr, Call);
CopyDebug(S, Call);
S->setAlignment(4); // EMSCRIPTEN: pnacl stack is only 4-byte aligned
}
}

Expand Down

0 comments on commit 6198caf

Please sign in to comment.