[PATCH] D81389: dwarf::isCPlusPlus fails with user language

Juan Wajnerman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 07:05:28 PDT 2020


waj created this revision.
waj added a reviewer: debug-info.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
waj added a comment.

This was already tested by Homebrew team (https://github.com/crystal-lang/crystal/issues/9148#issuecomment-632896285) and seems to be working correctly


As described in https://bugs.llvm.org/show_bug.cgi?id=46027, this function is currently failing for language codes falling between `DW_LANG_lo_user` and `DW_LANG_hi_user`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81389

Files:
  llvm/include/llvm/BinaryFormat/Dwarf.h


Index: llvm/include/llvm/BinaryFormat/Dwarf.h
===================================================================
--- llvm/include/llvm/BinaryFormat/Dwarf.h
+++ llvm/include/llvm/BinaryFormat/Dwarf.h
@@ -232,6 +232,8 @@
   case DW_LANG_hi_user:
     return false;
   }
+  if (S >= DW_LANG_lo_user && S <= DW_LANG_hi_user)
+    return false;
   llvm_unreachable("Invalid source language");
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81389.269206.patch
Type: text/x-patch
Size: 394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200608/f2aa9832/attachment-0001.bin>


More information about the llvm-commits mailing list