@@ -146,14 +146,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
146146 | "exit"
147147 | "ExitProcess"
148148 => {
149- check_abi ( abi, if link_name == "exit" { Abi :: C } else { Abi :: System } ) ?;
149+ check_abi ( abi, if link_name == "exit" { Abi :: C { unwind : false } } else { Abi :: System { unwind : false } } ) ?;
150150 let & [ ref code] = check_arg_count ( args) ?;
151151 // it's really u32 for ExitProcess, but we have to put it into the `Exit` variant anyway
152152 let code = this. read_scalar ( code) ?. to_i32 ( ) ?;
153153 throw_machine_stop ! ( TerminationInfo :: Exit ( code. into( ) ) ) ;
154154 }
155155 "abort" => {
156- check_abi ( abi, Abi :: C ) ?;
156+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
157157 throw_machine_stop ! ( TerminationInfo :: Abort ( "the program aborted execution" . to_owned( ) ) )
158158 }
159159 _ => throw_unsup_format ! ( "can't call (diverging) foreign function: {}" , link_name) ,
@@ -170,7 +170,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
170170 // Normally, this will be either `libpanic_unwind` or `libpanic_abort`, but it could
171171 // also be a custom user-provided implementation via `#![feature(panic_runtime)]`
172172 "__rust_start_panic" | "__rust_panic_cleanup" => {
173- check_abi ( abi, Abi :: C ) ?;
173+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
174174 // This replicates some of the logic in `inject_panic_runtime`.
175175 // FIXME: is there a way to reuse that logic?
176176 let panic_runtime = match this. tcx . sess . panic_strategy ( ) {
@@ -236,14 +236,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
236236
237237 // Standard C allocation
238238 "malloc" => {
239- check_abi ( abi, Abi :: C ) ?;
239+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
240240 let & [ ref size] = check_arg_count ( args) ?;
241241 let size = this. read_scalar ( size) ?. to_machine_usize ( this) ?;
242242 let res = this. malloc ( size, /*zero_init:*/ false , MiriMemoryKind :: C ) ;
243243 this. write_scalar ( res, dest) ?;
244244 }
245245 "calloc" => {
246- check_abi ( abi, Abi :: C ) ?;
246+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
247247 let & [ ref items, ref len] = check_arg_count ( args) ?;
248248 let items = this. read_scalar ( items) ?. to_machine_usize ( this) ?;
249249 let len = this. read_scalar ( len) ?. to_machine_usize ( this) ?;
@@ -253,13 +253,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
253253 this. write_scalar ( res, dest) ?;
254254 }
255255 "free" => {
256- check_abi ( abi, Abi :: C ) ?;
256+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
257257 let & [ ref ptr] = check_arg_count ( args) ?;
258258 let ptr = this. read_scalar ( ptr) ?. check_init ( ) ?;
259259 this. free ( ptr, MiriMemoryKind :: C ) ?;
260260 }
261261 "realloc" => {
262- check_abi ( abi, Abi :: C ) ?;
262+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
263263 let & [ ref old_ptr, ref new_size] = check_arg_count ( args) ?;
264264 let old_ptr = this. read_scalar ( old_ptr) ?. check_init ( ) ?;
265265 let new_size = this. read_scalar ( new_size) ?. to_machine_usize ( this) ?;
@@ -334,7 +334,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
334334
335335 // C memory handling functions
336336 "memcmp" => {
337- check_abi ( abi, Abi :: C ) ?;
337+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
338338 let & [ ref left, ref right, ref n] = check_arg_count ( args) ?;
339339 let left = this. read_scalar ( left) ?. check_init ( ) ?;
340340 let right = this. read_scalar ( right) ?. check_init ( ) ?;
@@ -355,7 +355,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
355355 this. write_scalar ( Scalar :: from_i32 ( result) , dest) ?;
356356 }
357357 "memrchr" => {
358- check_abi ( abi, Abi :: C ) ?;
358+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
359359 let & [ ref ptr, ref val, ref num] = check_arg_count ( args) ?;
360360 let ptr = this. read_scalar ( ptr) ?. check_init ( ) ?;
361361 let val = this. read_scalar ( val) ?. to_i32 ( ) ? as u8 ;
@@ -374,7 +374,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
374374 }
375375 }
376376 "memchr" => {
377- check_abi ( abi, Abi :: C ) ?;
377+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
378378 let & [ ref ptr, ref val, ref num] = check_arg_count ( args) ?;
379379 let ptr = this. read_scalar ( ptr) ?. check_init ( ) ?;
380380 let val = this. read_scalar ( val) ?. to_i32 ( ) ? as u8 ;
@@ -392,7 +392,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
392392 }
393393 }
394394 "strlen" => {
395- check_abi ( abi, Abi :: C ) ?;
395+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
396396 let & [ ref ptr] = check_arg_count ( args) ?;
397397 let ptr = this. read_scalar ( ptr) ?. check_init ( ) ?;
398398 let n = this. memory . read_c_str ( ptr) ?. len ( ) ;
@@ -408,7 +408,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
408408 | "asinf"
409409 | "atanf"
410410 => {
411- check_abi ( abi, Abi :: C ) ?;
411+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
412412 let & [ ref f] = check_arg_count ( args) ?;
413413 // FIXME: Using host floats.
414414 let f = f32:: from_bits ( this. read_scalar ( f) ?. to_u32 ( ) ?) ;
@@ -428,7 +428,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
428428 | "hypotf"
429429 | "atan2f"
430430 => {
431- check_abi ( abi, Abi :: C ) ?;
431+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
432432 let & [ ref f1, ref f2] = check_arg_count ( args) ?;
433433 // underscore case for windows, here and below
434434 // (see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/floating-point-primitives?view=vs-2019)
@@ -450,7 +450,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
450450 | "asin"
451451 | "atan"
452452 => {
453- check_abi ( abi, Abi :: C ) ?;
453+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
454454 let & [ ref f] = check_arg_count ( args) ?;
455455 // FIXME: Using host floats.
456456 let f = f64:: from_bits ( this. read_scalar ( f) ?. to_u64 ( ) ?) ;
@@ -470,7 +470,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
470470 | "hypot"
471471 | "atan2"
472472 => {
473- check_abi ( abi, Abi :: C ) ?;
473+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
474474 let & [ ref f1, ref f2] = check_arg_count ( args) ?;
475475 // FIXME: Using host floats.
476476 let f1 = f64:: from_bits ( this. read_scalar ( f1) ?. to_u64 ( ) ?) ;
@@ -486,7 +486,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
486486 | "ldexp"
487487 | "scalbn"
488488 => {
489- check_abi ( abi, Abi :: C ) ?;
489+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
490490 let & [ ref x, ref exp] = check_arg_count ( args) ?;
491491 // For radix-2 (binary) systems, `ldexp` and `scalbn` are the same.
492492 let x = this. read_scalar ( x) ?. to_f64 ( ) ?;
@@ -508,12 +508,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
508508
509509 // Architecture-specific shims
510510 "llvm.x86.sse2.pause" if this. tcx . sess . target . arch == "x86" || this. tcx . sess . target . arch == "x86_64" => {
511- check_abi ( abi, Abi :: C ) ?;
511+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
512512 let & [ ] = check_arg_count ( args) ?;
513513 this. yield_active_thread ( ) ;
514514 }
515515 "llvm.aarch64.hint" if this. tcx . sess . target . arch == "aarch64" => {
516- check_abi ( abi, Abi :: C ) ?;
516+ check_abi ( abi, Abi :: C { unwind : false } ) ?;
517517 let & [ ref hint] = check_arg_count ( args) ?;
518518 let hint = this. read_scalar ( hint) ?. to_i32 ( ) ?;
519519 match hint {
0 commit comments