From e6e7c80f0e093f339ad4a66b79a5b376e797a588 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 20 Sep 2020 21:41:29 -0700 Subject: [PATCH] [EHStreamer] Fix a "Continue to action" -fverbose-asm comment when multi-byte LEB128 encoding is needed This only happens with more than 64 action records and it is difficult to construct a test. --- lib/CodeGen/AsmPrinter/EHStreamer.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/EHStreamer.cpp b/lib/CodeGen/AsmPrinter/EHStreamer.cpp index 99ee4567fa5..ad2f8dc7076 100644 --- a/lib/CodeGen/AsmPrinter/EHStreamer.cpp +++ b/lib/CodeGen/AsmPrinter/EHStreamer.cpp @@ -587,15 +587,12 @@ MCSymbol *EHStreamer::emitExceptionTable() { Asm->emitSLEB128(Action.ValueForTypeID); // Action Record - // - // Self-relative signed displacement in bytes of the next action record, - // or 0 if there is no next action record. if (VerboseAsm) { - if (Action.NextAction == 0) { + if (Action.Previous == unsigned(-1)) { Asm->OutStreamer->AddComment(" No further actions"); } else { - unsigned NextAction = Entry + (Action.NextAction + 1) / 2; - Asm->OutStreamer->AddComment(" Continue to action "+Twine(NextAction)); + Asm->OutStreamer->AddComment(" Continue to action " + + Twine(Action.Previous + 1)); } } Asm->emitSLEB128(Action.NextAction);