dsw / oink-stack

Oink is a collaboration of C++ static analysis tools.
http://danielwilkerson.com/oink/index.html
154 stars 34 forks source link

Segfault when running elkhound/elkhound elkhound/examples/crash1.gr on Mac OS X #18

Open sam-ellis opened 7 years ago

sam-ellis commented 7 years ago

Receive a segfault when running elkhound/elkhound elkhound/examples/crash1.gr on Mac OS X. Have built the tools using Apple LLVM version 8.0.0 (clang-800.0.38). Debegging segfault reveals the cause to be dereferencing a null pointer when calling LocString::<< operator (loc.str is NULL). From the comments in ast/locstr.h I see that the loc.str is permitted to be NULL:

  // experimenting with allowing 'str' to be null, which is convenient
  // when the string table isn't available

In that case, the << operators should deal gracefully with str==NULL.