diff options
Diffstat (limited to 'lib/CodeGen/ShadowStackGCLowering.cpp')
-rw-r--r-- | lib/CodeGen/ShadowStackGCLowering.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/ShadowStackGCLowering.cpp b/lib/CodeGen/ShadowStackGCLowering.cpp index 3e12b32b12d4..17a4d76c4c80 100644 --- a/lib/CodeGen/ShadowStackGCLowering.cpp +++ b/lib/CodeGen/ShadowStackGCLowering.cpp @@ -1,9 +1,8 @@ //===- ShadowStackGCLowering.cpp - Custom lowering for shadow-stack gc ----===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -313,7 +312,8 @@ bool ShadowStackGCLowering::runOnFunction(Function &F) { AtEntry.SetInsertPoint(IP->getParent(), IP); // Initialize the map pointer and load the current head of the shadow stack. - Instruction *CurrentHead = AtEntry.CreateLoad(Head, "gc_currhead"); + Instruction *CurrentHead = + AtEntry.CreateLoad(StackEntryTy->getPointerTo(), Head, "gc_currhead"); Instruction *EntryMapPtr = CreateGEP(Context, AtEntry, ConcreteStackEntryTy, StackEntry, 0, 1, "gc_frame.map"); AtEntry.CreateStore(FrameMap, EntryMapPtr); @@ -354,7 +354,8 @@ bool ShadowStackGCLowering::runOnFunction(Function &F) { Instruction *EntryNextPtr2 = CreateGEP(Context, *AtExit, ConcreteStackEntryTy, StackEntry, 0, 0, "gc_frame.next"); - Value *SavedHead = AtExit->CreateLoad(EntryNextPtr2, "gc_savedhead"); + Value *SavedHead = AtExit->CreateLoad(StackEntryTy->getPointerTo(), + EntryNextPtr2, "gc_savedhead"); AtExit->CreateStore(SavedHead, Head); } |