Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Sylvain78
Copy link
Contributor

@Sylvain78 Sylvain78 commented Dec 20, 2025

Import PROT_READ
Change type of buf in sys_fstat
Change type of flags in sys_mmap

Change type of buf    in sys_fstat
Change type of flags in sys_mmap

(intrinsic @ proc (sys_fstat {fd : u32}
(mut {(ghost buf) : (? Stat)}) {p : (&sn buf)} :
(mut {(ghost buf) : (ref Stat)}) {p : (&sn buf)} :
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct; the type is (? Stat) because it need not be initialized before the function call.

(intrinsic @ proc (sys_mmap {pos : (sn {0 : u64})} {len : u64} {prot : u32}
{(ghost anon) : bool}
{flags : (sn {(if anon MAP_PRIVATE {MAP_PRIVATE + MAP_ANONYMOUS}) : u64})}
{flags : (sn {(if anon MAP_PRIVATE {MAP_PRIVATE + MAP_ANONYMOUS}) : nat})}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the flags are a u64 because it's a non-ghost argument to the function passed in one of the registers.

@Sylvain78 Sylvain78 closed this Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants