mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-22 08:58:47 +00:00
9409eb97ab
to be bypassed. This change merges upstream r366369, r366371, and r267068 (minus some test improvements). Also: - Address bugs breaking the build with all options disabled. [0] - Pin the python version to 3.6 rather than 2.7. PR: 239503 [0] Security: https://kb.cert.org/vuls/id/129209
88 lines
3.6 KiB
Diff
88 lines
3.6 KiB
Diff
commit 90ba54bf67c4c134d000b064121789a32c0c6a73
|
|
Author: Francis Visoiu Mistrih <francisvm@yahoo.com>
|
|
Date: Wed Jul 17 20:46:09 2019 +0000
|
|
|
|
[CodeGen][NFC] Simplify checks for stack protector index checking
|
|
|
|
Use `hasStackProtectorIndex()` instead of `getStackProtectorIndex() >=
|
|
0`.
|
|
|
|
llvm-svn: 366369
|
|
|
|
diff --git lib/CodeGen/LocalStackSlotAllocation.cpp b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
|
|
index bddd0c7732c..aa8f824c6b9 100644
|
|
--- lib/CodeGen/LocalStackSlotAllocation.cpp
|
|
+++ lib/CodeGen/LocalStackSlotAllocation.cpp
|
|
@@ -199,19 +199,19 @@ void LocalStackSlotPass::calculateFrameObjectOffsets(MachineFunction &Fn) {
|
|
// Make sure that the stack protector comes before the local variables on the
|
|
// stack.
|
|
SmallSet<int, 16> ProtectedObjs;
|
|
- if (MFI.getStackProtectorIndex() >= 0) {
|
|
+ if (MFI.hasStackProtectorIndex()) {
|
|
+ int StackProtectorFI = MFI.getStackProtectorIndex();
|
|
StackObjSet LargeArrayObjs;
|
|
StackObjSet SmallArrayObjs;
|
|
StackObjSet AddrOfObjs;
|
|
|
|
- AdjustStackOffset(MFI, MFI.getStackProtectorIndex(), Offset,
|
|
- StackGrowsDown, MaxAlign);
|
|
+ AdjustStackOffset(MFI, StackProtectorFI, Offset, StackGrowsDown, MaxAlign);
|
|
|
|
// Assign large stack objects first.
|
|
for (unsigned i = 0, e = MFI.getObjectIndexEnd(); i != e; ++i) {
|
|
if (MFI.isDeadObjectIndex(i))
|
|
continue;
|
|
- if (MFI.getStackProtectorIndex() == (int)i)
|
|
+ if (StackProtectorFI == (int)i)
|
|
continue;
|
|
|
|
switch (MFI.getObjectSSPLayout(i)) {
|
|
diff --git lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
|
|
index 8e31c070714..dfbf665321d 100644
|
|
--- lib/CodeGen/PrologEpilogInserter.cpp
|
|
+++ lib/CodeGen/PrologEpilogInserter.cpp
|
|
@@ -927,18 +927,18 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) {
|
|
// Make sure that the stack protector comes before the local variables on the
|
|
// stack.
|
|
SmallSet<int, 16> ProtectedObjs;
|
|
- if (MFI.getStackProtectorIndex() >= 0) {
|
|
+ if (MFI.hasStackProtectorIndex()) {
|
|
+ int StackProtectorFI = MFI.getStackProtectorIndex();
|
|
StackObjSet LargeArrayObjs;
|
|
StackObjSet SmallArrayObjs;
|
|
StackObjSet AddrOfObjs;
|
|
|
|
- AdjustStackOffset(MFI, MFI.getStackProtectorIndex(), StackGrowsDown,
|
|
- Offset, MaxAlign, Skew);
|
|
+ AdjustStackOffset(MFI, StackProtectorFI, StackGrowsDown, Offset, MaxAlign,
|
|
+ Skew);
|
|
|
|
// Assign large stack objects first.
|
|
for (unsigned i = 0, e = MFI.getObjectIndexEnd(); i != e; ++i) {
|
|
- if (MFI.isObjectPreAllocated(i) &&
|
|
- MFI.getUseLocalStackAllocationBlock())
|
|
+ if (MFI.isObjectPreAllocated(i) && MFI.getUseLocalStackAllocationBlock())
|
|
continue;
|
|
if (i >= MinCSFrameIndex && i <= MaxCSFrameIndex)
|
|
continue;
|
|
@@ -946,8 +946,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) {
|
|
continue;
|
|
if (MFI.isDeadObjectIndex(i))
|
|
continue;
|
|
- if (MFI.getStackProtectorIndex() == (int)i ||
|
|
- EHRegNodeFrameIndex == (int)i)
|
|
+ if (StackProtectorFI == (int)i || EHRegNodeFrameIndex == (int)i)
|
|
continue;
|
|
if (MFI.getStackID(i) !=
|
|
TargetStackID::Default) // Only allocate objects on the default stack.
|
|
@@ -990,8 +989,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) {
|
|
continue;
|
|
if (MFI.isDeadObjectIndex(i))
|
|
continue;
|
|
- if (MFI.getStackProtectorIndex() == (int)i ||
|
|
- EHRegNodeFrameIndex == (int)i)
|
|
+ if (MFI.getStackProtectorIndex() == (int)i || EHRegNodeFrameIndex == (int)i)
|
|
continue;
|
|
if (ProtectedObjs.count(i))
|
|
continue;
|