Alouest added a comment.

Greetings,

I stumbled upon a bug while toying with your example Bye.cpp. I modified your 
pass to make a ModulePass and while it works with

  /build/bin/opt -goodbye -wave-goodbye test.ll

It's making clang crash with the command

  /build/bin/clang test.c

I've included the pass, the error logs and some files to reproduce the bug 
(hello2.bc is supposed to be placed in the directory where you start your 
code). 
It seems that the bug is coming from StringMap.cpp, it looks like NumBuckets is 
not always initialized when accessed, raising a SegFault.
In my example, this function is called by Module::getFunction (StringRef).

I'm a beginner in LLVM so I might just be doing dumb things.

F10889373: test-df7efc.c <https://reviews.llvm.org/F10889373>

F10889372: Bye.cpp <https://reviews.llvm.org/F10889372>

F10889371: test.c <https://reviews.llvm.org/F10889371>

F10889370: test-df7efc.sh <https://reviews.llvm.org/F10889370>

F10889369: hello2.bc <https://reviews.llvm.org/F10889369>

F10889368: test.ll <https://reviews.llvm.org/F10889368>

F10889367: log <https://reviews.llvm.org/F10889367>


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61446/new/

https://reviews.llvm.org/D61446



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to