@@ -139,6 +139,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
139
139
Entry :: Occupied ( e) => e. into_mut ( ) ,
140
140
Entry :: Vacant ( e) => {
141
141
// Find it if it was not cached.
142
+ // The is true in case of a weak definition.
142
143
let mut instance_and_crate: Option < ( ty:: Instance < ' _ > , CrateNum , bool ) > = None ;
143
144
helpers:: iter_exported_symbols ( tcx, |cnum, def_id| {
144
145
let attrs = tcx. codegen_fn_attrs ( def_id) ;
@@ -161,6 +162,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
161
162
if let Some ( ( original_instance, original_cnum, original_is_weak) ) =
162
163
instance_and_crate
163
164
{
165
+ // There is more than one definition with this name. What we do now
166
+ // depends on whether one or both definitions are weak.
164
167
match ( is_weak, original_is_weak) {
165
168
( false , true ) => {
166
169
// Original definition is a weak definition. Override it.
@@ -174,7 +177,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
174
177
( true , true ) | ( false , false ) => {
175
178
// Either both definitions are non-weak or both are weak. In
176
179
// either case return an error. For weak definitions we error
177
- // because it is undefined which definition would have been
180
+ // because it is unspecified which definition would have been
178
181
// picked by the linker.
179
182
180
183
// Make sure we are consistent wrt what is 'first' and 'second'.
0 commit comments