@@ -380,7 +380,7 @@ TEST(execute, i32_load_all_variants)
380380 from_hex (" 0061736d0100000001060160017f017f030201000504010101010a0901070020002802000b" );
381381 const auto module = parse (wasm);
382382
383- auto & load_instr = module ->codesec [0 ].instructions [1 ];
383+ auto & load_instr = const_cast <Instr&>( module ->codesec [0 ].instructions [1 ]) ;
384384 ASSERT_EQ (load_instr, Instr::i32_load);
385385 ASSERT_EQ (module ->codesec [0 ].immediates .substr (4 ), " 00000000" _bytes); // load offset.
386386
@@ -418,7 +418,7 @@ TEST(execute, i64_load_all_variants)
418418 from_hex (" 0061736d0100000001060160017f017e030201000504010101010a0901070020002903000b" );
419419 const auto module = parse (wasm);
420420
421- auto & load_instr = module ->codesec [0 ].instructions [1 ];
421+ auto & load_instr = const_cast <Instr&>( module ->codesec [0 ].instructions [1 ]) ;
422422 ASSERT_EQ (load_instr, Instr::i64_load);
423423 ASSERT_EQ (module ->codesec [0 ].immediates .substr (4 ), " 00000000" _bytes); // load offset.
424424
@@ -529,7 +529,7 @@ TEST(execute, i32_store_all_variants)
529529 from_hex (" 0061736d0100000001060160027f7f00030201000504010101010a0b010900200120003602000b" );
530530 const auto module = parse (wasm);
531531
532- auto & store_instr = module ->codesec [0 ].instructions [2 ];
532+ auto & store_instr = const_cast <Instr&>( module ->codesec [0 ].instructions [2 ]) ;
533533 ASSERT_EQ (store_instr, Instr::i32_store);
534534 ASSERT_EQ (module ->codesec [0 ].immediates .substr (8 ), " 00000000" _bytes); // store offset
535535
@@ -565,7 +565,7 @@ TEST(execute, i64_store_all_variants)
565565 from_hex (" 0061736d0100000001060160027e7f00030201000504010101010a0b010900200120003703000b" );
566566 const auto module = parse (wasm);
567567
568- auto & store_instr = module ->codesec [0 ].instructions [2 ];
568+ auto & store_instr = const_cast <Instr&>( module ->codesec [0 ].instructions [2 ]) ;
569569 ASSERT_EQ (store_instr, Instr::i64_store);
570570 ASSERT_EQ (module ->codesec [0 ].immediates .substr (8 ), " 00000000" _bytes); // store offset
571571
0 commit comments