Skip to content

Commit 3871c49

Browse files
author
hyd-dev
committed
in_std -> frame_in_std
1 parent 5451010 commit 3871c49

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
629629
Ok(())
630630
}
631631

632-
fn in_std(&self) -> bool {
632+
fn frame_in_std(&self) -> bool {
633633
let this = self.eval_context_ref();
634634
this.tcx.lang_items().start_fn().map_or(false, |start_fn| {
635635
this.tcx.def_path(this.frame().instance.def_id()).krate

src/shims/posix/foreign_items.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
475475
// Incomplete shims that we "stub out" just to get pre-main initialization code to work.
476476
// These shims are enabled only when the caller is in the standard library.
477477
"pthread_attr_getguardsize"
478-
if this.in_std() => {
478+
if this.frame_in_std() => {
479479
this.check_abi(abi, Abi::C { unwind: false })?;
480480
let &[ref _attr, ref guard_size] = check_arg_count(args)?;
481481
let guard_size = this.deref_operand(guard_size)?;
@@ -488,28 +488,28 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
488488

489489
| "pthread_attr_init"
490490
| "pthread_attr_destroy"
491-
if this.in_std() => {
491+
if this.frame_in_std() => {
492492
this.check_abi(abi, Abi::C { unwind: false })?;
493493
let &[_] = check_arg_count(args)?;
494494
this.write_null(dest)?;
495495
}
496496
| "pthread_attr_setstacksize"
497-
if this.in_std() => {
497+
if this.frame_in_std() => {
498498
this.check_abi(abi, Abi::C { unwind: false })?;
499499
let &[_, _] = check_arg_count(args)?;
500500
this.write_null(dest)?;
501501
}
502502

503503
| "signal"
504504
| "sigaltstack"
505-
if this.in_std() => {
505+
if this.frame_in_std() => {
506506
this.check_abi(abi, Abi::C { unwind: false })?;
507507
let &[_, _] = check_arg_count(args)?;
508508
this.write_null(dest)?;
509509
}
510510
| "sigaction"
511511
| "mprotect"
512-
if this.in_std() => {
512+
if this.frame_in_std() => {
513513
this.check_abi(abi, Abi::C { unwind: false })?;
514514
let &[_, _, _] = check_arg_count(args)?;
515515
this.write_null(dest)?;

src/shims/posix/linux/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
207207

208208
// Incomplete shims that we "stub out" just to get pre-main initialization code to work.
209209
// These shims are enabled only when the caller is in the standard library.
210-
"pthread_getattr_np" if this.in_std() => {
210+
"pthread_getattr_np" if this.frame_in_std() => {
211211
this.check_abi(abi, Abi::C { unwind: false })?;
212212
let &[ref _thread, ref _attr] = check_arg_count(args)?;
213213
this.write_null(dest)?;

src/shims/posix/macos/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
149149

150150
// Incomplete shims that we "stub out" just to get pre-main initialization code to work.
151151
// These shims are enabled only when the caller is in the standard library.
152-
"mmap" if this.in_std() => {
152+
"mmap" if this.frame_in_std() => {
153153
this.check_abi(abi, Abi::C { unwind: false })?;
154154
// This is a horrible hack, but since the guard page mechanism calls mmap and expects a particular return value, we just give it that value.
155155
let &[ref addr, _, _, _, _, _] = check_arg_count(args)?;

src/shims/windows/foreign_items.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,27 +348,27 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
348348

349349
// Incomplete shims that we "stub out" just to get pre-main initialization code to work.
350350
// These shims are enabled only when the caller is in the standard library.
351-
"GetProcessHeap" if this.in_std() => {
351+
"GetProcessHeap" if this.frame_in_std() => {
352352
this.check_abi(abi, Abi::System { unwind: false })?;
353353
let &[] = check_arg_count(args)?;
354354
// Just fake a HANDLE
355355
this.write_scalar(Scalar::from_machine_isize(1, this), dest)?;
356356
}
357-
"SetConsoleTextAttribute" if this.in_std() => {
357+
"SetConsoleTextAttribute" if this.frame_in_std() => {
358358
this.check_abi(abi, Abi::System { unwind: false })?;
359359
#[allow(non_snake_case)]
360360
let &[ref _hConsoleOutput, ref _wAttribute] = check_arg_count(args)?;
361361
// Pretend these does not exist / nothing happened, by returning zero.
362362
this.write_null(dest)?;
363363
}
364-
"AddVectoredExceptionHandler" if this.in_std() => {
364+
"AddVectoredExceptionHandler" if this.frame_in_std() => {
365365
this.check_abi(abi, Abi::System { unwind: false })?;
366366
#[allow(non_snake_case)]
367367
let &[ref _First, ref _Handler] = check_arg_count(args)?;
368368
// Any non zero value works for the stdlib. This is just used for stack overflows anyway.
369369
this.write_scalar(Scalar::from_machine_usize(1, this), dest)?;
370370
}
371-
"SetThreadStackGuarantee" if this.in_std() => {
371+
"SetThreadStackGuarantee" if this.frame_in_std() => {
372372
this.check_abi(abi, Abi::System { unwind: false })?;
373373
#[allow(non_snake_case)]
374374
let &[_StackSizeInBytes] = check_arg_count(args)?;
@@ -379,7 +379,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
379379
| "EnterCriticalSection"
380380
| "LeaveCriticalSection"
381381
| "DeleteCriticalSection"
382-
if this.in_std() =>
382+
if this.frame_in_std() =>
383383
{
384384
this.check_abi(abi, Abi::System { unwind: false })?;
385385
#[allow(non_snake_case)]
@@ -393,7 +393,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
393393
// (Windows locks are reentrant, and we have only 1 thread,
394394
// so not doing any futher checks here is at least not incorrect.)
395395
}
396-
"TryEnterCriticalSection" if this.in_std() => {
396+
"TryEnterCriticalSection" if this.frame_in_std() => {
397397
this.check_abi(abi, Abi::System { unwind: false })?;
398398
#[allow(non_snake_case)]
399399
let &[ref _lpCriticalSection] = check_arg_count(args)?;

0 commit comments

Comments
 (0)