Skip to content

Commit 7894495

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

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
@@ -7400,7 +7400,9 @@ SDValue SelectionDAG::FoldConstantBuildVector(BuildVectorSDNode *BV,
74007400
}
74017401

74027402
SDValue SelectionDAG::getAssertAlign(const SDLoc &DL, SDValue Val, Align A) {
7403-
assert(Val.getValueType().isInteger() && "Invalid AssertAlign!");
7403+
assert(
7404+
(Val.getValueType().isInteger() || Val.getValueType().isCapability()) &&
7405+
"Invalid AssertAlign!");
74047406

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

0 commit comments

Comments
 (0)