about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-09-22 11:56:08 +0000
committerbors <bors@rust-lang.org>2018-09-22 11:56:08 +0000
commite7b5ba8661aa844a06c37f22d7af0afb1807d347 (patch)
tree9d25bc6a9f3e8b4ee56a2eb06558a1491fcae6b1 /src/rustllvm/RustWrapper.cpp
parent4a6e875b81c610a4131b377a27029c1837973f31 (diff)
parent1b938068b601ffa211e5503f565d082d78ebcd14 (diff)
downloadrust-e7b5ba8661aa844a06c37f22d7af0afb1807d347.tar.gz
rust-e7b5ba8661aa844a06c37f22d7af0afb1807d347.zip
Auto merge of #54265 - arielb1:civilize-proc-macros, r=alexcrichton
avoid leaking host details in proc macro metadata decoding

proc macro crates are essentially implemented as dynamic libraries using
a dlopen-based ABI. They are also Rust crates, so they have 2 worlds -
the "host" world in which they are defined, and the "target" world in
which they are used.

For all the "target" world knows, the proc macro crate might not even
be implemented in Rust, so leaks of details from the host to the target
must be avoided for correctness.

Because the "host" DefId space is different from the "target" DefId
space, any leak involving a DefId will have a nonsensical or
out-of-bounds DefKey, and will cause all sorts of crashes.

This PR fixes all leaks I have found in `decoder`. In particular, #54059
was caused by host native libraries leaking into the target, which feels
like it might even be a correctness issue if it doesn't cause an ICE.

Fixes #54059
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions