mirror of
				https://github.com/roc-lang/roc.git
				synced 2025-10-31 13:14:20 +00:00 
			
		
		
		
	 b4fa7294c7
			
		
	
	
		b4fa7294c7
		
			
		
	
	
	
	
		
			
			Importantly, this would have caught the issue discovered in #7279, prior to that landing on main.
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			490 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			490 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #![no_main]
 | |
| use bumpalo::Bump;
 | |
| use libfuzzer_sys::fuzz_target;
 | |
| use roc_parse::ast::Malformed;
 | |
| use test_syntax::test_helpers::Input;
 | |
| 
 | |
| fuzz_target!(|data: &[u8]| {
 | |
|     if let Ok(input) = std::str::from_utf8(data) {
 | |
|         let input = Input::Expr(input);
 | |
|         let arena = Bump::new();
 | |
|         let ast = input.parse_in(&arena);
 | |
|         if let Ok(ast) = ast {
 | |
|             if !ast.is_malformed() {
 | |
|                 input.check_invariants(|_| (), true, None);
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| });
 |