Skip to content

Commit 2e25b58

Browse files
bjorn3RalfJung
andcommitted
Add a couple of comments
Co-Authored-By: Ralf Jung <[email protected]>
1 parent 7e467cd commit 2e25b58

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tools/miri/src/shims/foreign_items.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
5151

5252
// Some shims forward to other MIR bodies.
5353
match link_name.as_str() {
54+
// This allocator function has forwarding shims synthesized during normal codegen
55+
// (see `allocator_shim_contents`); this is where we emulate that behavior.
5456
// FIXME should use global_fn_name, but mangle_internal_symbol requires a static str.
5557
name if name == this.mangle_internal_symbol("__rust_alloc_error_handler") => {
5658
// Forward to the right symbol that implements this function.
@@ -68,6 +70,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
6870
.expect("missing alloc error handler symbol");
6971
return interp_ok(Some(handler));
7072
}
73+
// Fall through to the `lookup_exported_symbol` below which should find
74+
// a `__rust_alloc_error_handler`.
7175
}
7276
_ => {}
7377
}

0 commit comments

Comments
 (0)