[Lldb-commits] [PATCH] D72596: [lldb] Don't defend against internal LLVM errors in IRInterpreter

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 13 03:20:04 PST 2020


teemperor created this revision.
teemperor added reviewers: labath, mib.
Herald added subscribers: lldb-commits, JDevlieghere, abidh.
Herald added a project: LLDB.
teemperor edited the summary of this revision.

Whenever we cast an LLVM instruction to one of its subclasses, we do a double check if the RTTI
enum value actually allows us to cast the class. I don't see a way this can ever happen as even when
LLVM's RTTI system has some corrupt internal state (which we probably should not test in the first
place) we just reuse LLVM RTTI to do the second check.

This also means that if we ever make an actual programming error in this function (e.g., have a enum
value and then cast it to a different subclass), we just silently fall back to the JIT in our tests.

This removes the checks and does `llvm::cast` which will raise a fatal error in these situations.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D72596

Files:
  lldb/source/Expression/IRInterpreter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72596.237612.patch
Type: text/x-patch
Size: 7727 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200113/b46be390/attachment-0001.bin>


More information about the lldb-commits mailing list