Skip to content
Commit 7a66fe10 authored by Stefan Gränitz's avatar Stefan Gränitz
Browse files

Wrap `llvm_unreachable` macro in do-while loop

Macros that expand into multiple terms can cause interesting preprocessor hickups depending
on the context they are used in. https://github.com/llvm/llvm-project/issues/56867 reported
a miscompilation of `llvm_unreachable(msg)` inside a `LLVM_DEBUG({ ... })` block. We were
able to fix it by wrapping the expansion in a `do {} while(false)`.

Differential Revision: https://reviews.llvm.org/D131337
parent b3347094
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment