[PATCH] D51695: [MC] [AsmParser]: Ensure a new CFI frame is not opened within an existing one when using cc1as (causing a crash due to failed assert).

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 10 11:43:04 PDT 2018


rnk added a comment.

In https://reviews.llvm.org/D51695#1228444, @kristina wrote:

> This is a testcase for the crash, patch fixes it, though I'll amend it to work on MCStreamer level as per what @rnk suggested. I'm going to sound really stupid asking but where should the testcase be, is it a FileCheck based one? I just made two targets, one with pre-patch toolchain and one with current (my working tree) toolchain which handles this just fine. First one crashes, second one doesn't, not sure where tests like that go.


Yeah, we definitely want a lit test. I think the one we already have exercises this code path, but because it doesn't create an object file, it doesn't assert. I think if you apply this patch, the test will start failing, and your fix should make it pass again:

  diff --git a/llvm/test/MC/X86/cfi-scope-errors.s b/llvm/test/MC/X86/cfi-scope-errors.s
  index a61f817f741e..91d42b9662b6 100644
  --- a/llvm/test/MC/X86/cfi-scope-errors.s
  +++ b/llvm/test/MC/X86/cfi-scope-errors.s
  @@ -1,4 +1,4 @@
  -# RUN: not llvm-mc %s -triple x86_64-linux -o /dev/null 2>&1 | FileCheck %s --implicit-check-not=error:
  +# RUN: not llvm-mc %s -triple x86_64-linux -filetype=obj -o /dev/null 2>&1 | FileCheck %s --implicit-check-not=error:
  
   # FIXME: Push source locations into diagnostics.

If you thread through the SMLoc you'll even address the FIXME.


Repository:
  rL LLVM

https://reviews.llvm.org/D51695





More information about the llvm-commits mailing list