mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
Tests: Fix new GCC 12 warnings
This commit is contained in:
parent
cccc001ded
commit
699bd9afc6
Notes:
sideshowbarker
2024-07-17 12:00:11 +09:00
Author: https://github.com/BertalanD
Commit: 699bd9afc6
Pull-request: https://github.com/SerenityOS/serenity/pull/13954
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/EWouters
Reviewed-by: https://github.com/timschumi ✅
3 changed files with 10 additions and 9 deletions
|
@ -139,7 +139,10 @@ int main(int argc, char** argv)
|
|||
return Crash::Failure::UnexpectedError;
|
||||
|
||||
free(uninitialized_memory);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wuse-after-free"
|
||||
[[maybe_unused]] volatile auto x = uninitialized_memory[4][0];
|
||||
#pragma GCC diagnostic pop
|
||||
return Crash::Failure::DidNotCrash;
|
||||
}).run(run_type);
|
||||
}
|
||||
|
@ -161,8 +164,11 @@ int main(int argc, char** argv)
|
|||
if (!uninitialized_memory)
|
||||
return Crash::Failure::UnexpectedError;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wuse-after-free"
|
||||
free(uninitialized_memory);
|
||||
uninitialized_memory[4][0] = 1;
|
||||
#pragma GCC diagnostic pop
|
||||
return Crash::Failure::DidNotCrash;
|
||||
}).run(run_type);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue