1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[safestack] Fix alignment of dynamic allocas.

Fixes PR25588.

llvm-svn: 254109
This commit is contained in:
Evgeniy Stepanov 2015-11-25 22:52:30 +00:00
parent 3e341c0824
commit ef8f40a43e
2 changed files with 2 additions and 2 deletions

View File

@ -541,7 +541,7 @@ void SafeStack::moveDynamicAllocasToUnsafeStack(
if (DynamicTop)
IRB.CreateStore(NewTop, DynamicTop);
Value *NewAI = IRB.CreateIntToPtr(SP, AI->getType());
Value *NewAI = IRB.CreatePointerCast(NewTop, AI->getType());
if (AI->hasName() && isa<Instruction>(NewAI))
NewAI->takeName(AI);

View File

@ -25,7 +25,7 @@ entry:
; CHECK-NEXT: %[[INTTOPTR:.*]] = inttoptr i64 %[[AND]] to i8*
; CHECK-NEXT: store i8* %[[INTTOPTR]], i8** @__safestack_unsafe_stack_ptr
; CHECK-NEXT: store i8* %[[INTTOPTR]], i8** %unsafe_stack_dynamic_ptr
; CHECK-NEXT: %[[ALLOCA:.*]] = inttoptr i64 %[[SUB]] to i32*
; CHECK-NEXT: %[[ALLOCA:.*]] = bitcast i8* %[[INTTOPTR]] to i32*
%a = alloca i32, i32 %size
; CHECK: setjmp