File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
crates/wasm-mutate/src/mutators Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,8 @@ impl PeepholeMutator {
254254 let iterator = iterator
255255 . filter ( move |expr| !expr. to_string ( ) . eq ( & startcmp. to_string ( ) ) )
256256 . map ( move |expr| {
257+ log:: trace!( "Yielding expression:\n {}" , expr. pretty( 60 ) ) ;
258+
257259 let mut newfunc = self . copy_locals ( reader) ?;
258260 let needed_resources = Encoder :: build_function (
259261 config,
Original file line number Diff line number Diff line change @@ -489,7 +489,7 @@ impl PeepholeMutator {
489489 // `x <=> x << 1`
490490 rules. extend ( rewrite ! (
491491 "i32.shl-1" ;
492- "?x" <=> "(i32.shl ?x 1_i64 )"
492+ "?x" <=> "(i32.shl ?x 1_i32 )"
493493 if self . is_type( "?x" , PrimitiveTypeInfo :: I32 )
494494 ) ) ;
495495 rules. extend ( rewrite ! (
@@ -501,7 +501,7 @@ impl PeepholeMutator {
501501 // `x <=> x >> 1`
502502 rules. extend ( rewrite ! (
503503 "i32.shr_u-1" ;
504- "?x" <=> "(i32.shr_u ?x 1_i64 )"
504+ "?x" <=> "(i32.shr_u ?x 1_i32 )"
505505 if self . is_type( "?x" , PrimitiveTypeInfo :: I32 )
506506 ) ) ;
507507 rules. extend ( rewrite ! (
@@ -511,7 +511,7 @@ impl PeepholeMutator {
511511 ) ) ;
512512 rules. extend ( rewrite ! (
513513 "i32.shr_s-1" ;
514- "?x" <=> "(i32.shr_s ?x 1_i64 )"
514+ "?x" <=> "(i32.shr_s ?x 1_i32 )"
515515 if self . is_type( "?x" , PrimitiveTypeInfo :: I32 )
516516 ) ) ;
517517 rules. extend ( rewrite ! (
Original file line number Diff line number Diff line change @@ -91,9 +91,11 @@ fuzz_target!(|bytes: &[u8]| {
9191 log:: debug!( "validation result = {:?}" , validation_result) ;
9292
9393 if log:: log_enabled!( log:: Level :: Debug ) {
94+ log:: debug!( "writing mutated Wasm to `mutated.wasm`" ) ;
9495 std:: fs:: write( "mutated.wasm" , & mutated_wasm)
9596 . expect( "should write `mutated.wasm` okay" ) ;
9697 if let Ok ( mutated_wat) = wasmprinter:: print_bytes( & mutated_wasm) {
98+ log:: debug!( "writing mutated WAT to `mutated.wat`" ) ;
9799 std:: fs:: write( "mutated.wat" , & mutated_wat)
98100 . expect( "should write `mutated.wat` okay" ) ;
99101 }
You can’t perform that action at this time.
0 commit comments