Skip to content

Commit

Permalink
make valgrind happy
Browse files Browse the repository at this point in the history
  • Loading branch information
bhansconnect committed Dec 16, 2024
1 parent 3325b26 commit edd1da7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ pub extern "C" fn rust_main() -> i32 {
let arg = env::args()
.nth(1)
.expect("Please pass a .false file as a command-line argument to the false interpreter!");
let arg = RocStr::from(arg.as_str());
let arg = ManuallyDrop::new(RocStr::from(arg.as_str()));

unsafe { roc_main(ManuallyDrop::new(arg)) };
unsafe { roc_main(arg) };

// This really shouldn't need to be freed, but valgrid is picky about possibly lost.
*file_handles().lock().unwrap() = HashMap::default();

// Exit code
0
Expand Down

0 comments on commit edd1da7

Please sign in to comment.