Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace addr_of with &raw across the codebase #2669

Merged
merged 18 commits into from
Nov 8, 2024
Merged

Replace addr_of with &raw across the codebase #2669

merged 18 commits into from
Nov 8, 2024

Conversation

domenukk
Copy link
Member

@domenukk domenukk commented Nov 7, 2024

More modern rust is more modern

Copy link
Collaborator

@rmalmain rmalmain left a comment

Choose a reason for hiding this comment

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

good stuff

@@ -27,8 +24,8 @@ use libafl_bolts::{rands::StdRand, tuples::tuple_list, AsSlice};

/// Coverage map with explicit assignments due to the lack of instrumentation
static mut SIGNALS: [u8; 64] = [0; 64];
static mut SIGNALS_PTR: *mut u8 = addr_of_mut!(SIGNALS).cast();
static mut SIGNALS_LEN: usize = unsafe { (*addr_of!(SIGNALS)).len() };
static mut SIGNALS_PTR: *mut u8 = &raw mut (SIGNALS).cast();
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't need all these parentheses anymore, i guess.
or maybe some like this: (&raw const ...) instead of &raw const (...) to enforce operation prioritization.

Copy link
Member Author

Choose a reason for hiding this comment

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

Trying to get rid of some manually, but it's work :D sholud be done with a regex

Copy link
Member Author

Choose a reason for hiding this comment

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

This one in particular should use ConstLenObserver anyway, right?

@domenukk domenukk merged commit 21f8b1d into main Nov 8, 2024
100 checks passed
@domenukk domenukk deleted the ref_raw branch November 8, 2024 16:19
riesentoaster pushed a commit to riesentoaster/LibAFL that referenced this pull request Nov 9, 2024
* Replace addr_of with &raw across the codebase

* fix fixes

* more fix

* undo clang fmt?

* oops

* fix?

* allocator fix

* more fix

* more more

* more docs

* more fix

* mas mas mas

* hm

* more

* fix Frida

* needed

* more error

* qemu
riesentoaster pushed a commit to riesentoaster/LibAFL that referenced this pull request Nov 9, 2024
* Replace addr_of with &raw across the codebase

* fix fixes

* more fix

* undo clang fmt?

* oops

* fix?

* allocator fix

* more fix

* more more

* more docs

* more fix

* mas mas mas

* hm

* more

* fix Frida

* needed

* more error

* qemu
riesentoaster pushed a commit to riesentoaster/LibAFL that referenced this pull request Nov 9, 2024
* Replace addr_of with &raw across the codebase

* fix fixes

* more fix

* undo clang fmt?

* oops

* fix?

* allocator fix

* more fix

* more more

* more docs

* more fix

* mas mas mas

* hm

* more

* fix Frida

* needed

* more error

* qemu
riesentoaster pushed a commit to riesentoaster/LibAFL that referenced this pull request Nov 9, 2024
* Replace addr_of with &raw across the codebase

* fix fixes

* more fix

* undo clang fmt?

* oops

* fix?

* allocator fix

* more fix

* more more

* more docs

* more fix

* mas mas mas

* hm

* more

* fix Frida

* needed

* more error

* qemu
riesentoaster pushed a commit to riesentoaster/LibAFL that referenced this pull request Nov 9, 2024
* Replace addr_of with &raw across the codebase

* fix fixes

* more fix

* undo clang fmt?

* oops

* fix?

* allocator fix

* more fix

* more more

* more docs

* more fix

* mas mas mas

* hm

* more

* fix Frida

* needed

* more error

* qemu
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