aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp3
-rw-r--r--test/NaCl/PNaClABI/instructions.ll2
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
index 55269dc9fe..5e773e9751 100644
--- a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
+++ b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
@@ -65,6 +65,8 @@ bool PNaClABIVerifyFunctions::runOnFunction(Function &F) {
switch (BBI->getOpcode()) {
// Disallowed instructions. Default is to disallow.
default:
+ // We expand GetElementPtr out into arithmetic.
+ case Instruction::GetElementPtr:
// indirectbr may interfere with streaming
case Instruction::IndirectBr:
// No vector instructions yet
@@ -112,7 +114,6 @@ bool PNaClABIVerifyFunctions::runOnFunction(Function &F) {
case Instruction::Fence:
case Instruction::AtomicCmpXchg:
case Instruction::AtomicRMW:
- case Instruction::GetElementPtr:
// Conversion operations
case Instruction::Trunc:
case Instruction::ZExt:
diff --git a/test/NaCl/PNaClABI/instructions.ll b/test/NaCl/PNaClABI/instructions.ll
index 3bd95c8e0f..49585b1fca 100644
--- a/test/NaCl/PNaClABI/instructions.ll
+++ b/test/NaCl/PNaClABI/instructions.ll
@@ -71,6 +71,8 @@ define void @memory() {
fence acq_rel
%a3 = cmpxchg i32* undef, i32 undef, i32 undef acq_rel
%a4 = atomicrmw add i32* undef, i32 1 acquire
+; CHECK-NOT: disallowed
+; CHECK: Function memory has disallowed instruction: getelementptr
%a5 = getelementptr { i32, i32}* undef
ret void
}