Skip to content

Commit 529700b

Browse files
Switch assertion because the parser should have failed. Fix comment.
1 parent 45f8eee commit 529700b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

llvm/lib/MC/MCSFrame.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,8 @@ class SFrameEmitterImpl {
254254
// a problem, but allow others through. As an even more special case,
255255
// allow SP + 0.
256256
auto Reg = I.getOperandAsUnsigned(P, 0);
257-
if (!Reg) {
258-
Streamer.getContext().reportWarning(
259-
CFI.getLoc(),
260-
"skipping SFrame FDE; .cfi_escape with unknown effects");
261-
}
257+
// The parser should have failed in this case.
258+
assert(Reg && "DW_CFA_val_offset with no register.");
262259
bool SPOk = true;
263260
if (*Reg == SPReg) {
264261
auto Opnd = I.getOperandAsSigned(P, 1);

llvm/test/MC/ELF/cfi-sframe-cfi-escape.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cfi_escape_ok:
2323
cfi_escape_gnu_args_fp:
2424
.cfi_startproc
2525
.long 0
26-
# DW_CFA_GNU_args_size is OK arg size is zero
26+
# DW_CFA_GNU_args_size is OK if arg size is zero
2727
.cfi_escape 0x2e, 0x0
2828
.long 0
2929
.cfi_def_cfa_register 6

0 commit comments

Comments
 (0)