message: test: invalid global index in element section offset expression
diff: @@ -140,8 +140,20 @@ TEST(validation, data_section_invalid_offset_expression)
  "constant expression can use global.get only for const globals");
  }
  -TEST(validation, element_section_offset_from_mutable_global)
  +TEST(validation, element_section_invalid_offset_expression)
  {
  + /* wat2wasm --no-check
  + (table 4 funcref)
  + (elem (global.get 0) 0 1)
  + (func)
  + (func)
  + */
  + const auto bin1 = from_hex(
  + "0061736d0100000001040160000003030200000404017000040908010023000b0200010a070202000b02000b");
  +
  + EXPECT_THROW_MESSAGE(
  + parse(bin1), validation_error, "invalid global index in constant expression");
  +
  /* wat2wasm --no-check
  (global (mut i32) (i32.const 42))
  (table 4 funcref)
  @@ -149,11 +161,11 @@ TEST(validation, element_section_offset_from_mutable_global)
  (func)
  (func)
  */
  - const auto bin = from_hex(
  + const auto bin2 = from_hex(
  "0061736d0100000001040160000003030200000404017000040606017f01412a0b0908010023000b0200010a07"
  "0202000b02000b");
  - EXPECT_THROW_MESSAGE(parse(bin), validation_error,
  + EXPECT_THROW_MESSAGE(parse(bin2), validation_error,
  "constant expression can use global.get only for const globals");
  }
  