Skip to content

Commit 5576cb4

Browse files
committed
[CHERI] Adjust assertion when building alignment assertions in SelectionDAG to work properly for CHERI.
1 parent e652e2a commit 5576cb4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7216,7 +7216,9 @@ SDValue SelectionDAG::foldConstantFPMath(unsigned Opcode, const SDLoc &DL,
72167216
}
72177217

72187218
SDValue SelectionDAG::getAssertAlign(const SDLoc &DL, SDValue Val, Align A) {
7219-
assert(Val.getValueType().isInteger() && "Invalid AssertAlign!");
7219+
assert(
7220+
(Val.getValueType().isInteger() || Val.getValueType().isCapability()) &&
7221+
"Invalid AssertAlign!");
72207222

72217223
// There's no need to assert on a byte-aligned pointer. All pointers are at
72227224
// least byte aligned.

0 commit comments

Comments
 (0)