diff options
Diffstat (limited to 'src/binary-reader.cc')
-rw-r--r-- | src/binary-reader.cc | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/binary-reader.cc b/src/binary-reader.cc index 6d309172..d99e10ce 100644 --- a/src/binary-reader.cc +++ b/src/binary-reader.cc @@ -119,7 +119,7 @@ class BinaryReader { Limits* out_elem_limits) WABT_WARN_UNUSED; Result ReadMemory(Limits* out_page_limits) WABT_WARN_UNUSED; Result ReadGlobalHeader(Type* out_type, bool* out_mutable) WABT_WARN_UNUSED; - Result ReadExceptionType(TypeVector& sig) WABT_WARN_UNUSED; + Result ReadEventType(TypeVector& sig) WABT_WARN_UNUSED; Result ReadFunctionBody(Offset end_offset) WABT_WARN_UNUSED; Result ReadNameSection(Offset section_size) WABT_WARN_UNUSED; Result ReadRelocSection(Offset section_size) WABT_WARN_UNUSED; @@ -138,7 +138,7 @@ class BinaryReader { Result ReadCodeSection(Offset section_size) WABT_WARN_UNUSED; Result ReadDataSection(Offset section_size) WABT_WARN_UNUSED; Result ReadDataCountSection(Offset section_size) WABT_WARN_UNUSED; - Result ReadExceptionSection(Offset section_size) WABT_WARN_UNUSED; + Result ReadEventSection(Offset section_size) WABT_WARN_UNUSED; Result ReadSections() WABT_WARN_UNUSED; Result ReportUnexpectedOpcode(Opcode opcode, const char* message = nullptr); @@ -159,14 +159,14 @@ class BinaryReader { Index num_table_imports_ = 0; Index num_memory_imports_ = 0; Index num_global_imports_ = 0; - Index num_exception_imports_ = 0; + Index num_event_imports_ = 0; Index num_function_signatures_ = 0; Index num_tables_ = 0; Index num_memories_ = 0; Index num_globals_ = 0; Index num_exports_ = 0; Index num_function_bodies_ = 0; - Index num_exceptions_ = 0; + Index num_events_ = 0; Index data_count_ = kInvalidIndex; using ReadEndRestoreGuard = @@ -1178,7 +1178,7 @@ Result BinaryReader::ReadFunctionBody(Offset end_offset) { case Opcode::Throw: { Index index; - CHECK_RESULT(ReadIndex(&index, "exception index")); + CHECK_RESULT(ReadIndex(&index, "event index")); CALLBACK(OnThrowExpr, index); CALLBACK(OnOpcodeIndex, index); break; @@ -1675,33 +1675,33 @@ Result BinaryReader::ReadLinkingSection(Offset section_size) { return Result::Ok; } -Result BinaryReader::ReadExceptionType(TypeVector& sig) { +Result BinaryReader::ReadEventType(TypeVector& sig) { Index num_values; - CHECK_RESULT(ReadCount(&num_values, "exception type count")); + CHECK_RESULT(ReadCount(&num_values, "event type count")); sig.resize(num_values); for (Index j = 0; j < num_values; ++j) { Type value_type; - CHECK_RESULT(ReadType(&value_type, "exception value type")); + CHECK_RESULT(ReadType(&value_type, "event value type")); ERROR_UNLESS(IsConcreteType(value_type), - "excepted valid exception value type (got %d)", + "expected valid event value type (got %d)", static_cast<int>(value_type)); sig[j] = value_type; } return Result::Ok; } -Result BinaryReader::ReadExceptionSection(Offset section_size) { - CALLBACK(BeginExceptionSection, section_size); - CHECK_RESULT(ReadCount(&num_exceptions_, "exception count")); - CALLBACK(OnExceptionCount, num_exceptions_); +Result BinaryReader::ReadEventSection(Offset section_size) { + CALLBACK(BeginEventSection, section_size); + CHECK_RESULT(ReadCount(&num_events_, "event count")); + CALLBACK(OnEventCount, num_events_); - for (Index i = 0; i < num_exceptions_; ++i) { + for (Index i = 0; i < num_events_; ++i) { TypeVector sig; - CHECK_RESULT(ReadExceptionType(sig)); - CALLBACK(OnExceptionType, i, sig); + CHECK_RESULT(ReadEventType(sig)); + CALLBACK(OnEventType, i, sig); } - CALLBACK(EndExceptionSection); + CALLBACK(EndEventSection); return Result::Ok; } @@ -1838,15 +1838,15 @@ Result BinaryReader::ReadImportSection(Offset section_size) { break; } - case ExternalKind::Except: { + case ExternalKind::Event: { ERROR_UNLESS(options_.features.exceptions_enabled(), - "invalid import exception kind: exceptions not allowed"); + "invalid import event kind: exceptions not allowed"); TypeVector sig; - CHECK_RESULT(ReadExceptionType(sig)); + CHECK_RESULT(ReadEventType(sig)); CALLBACK(OnImport, i, module_name, field_name); - CALLBACK(OnImportException, i, module_name, field_name, - num_exception_imports_, sig); - num_exception_imports_++; + CALLBACK(OnImportEvent, i, module_name, field_name, num_event_imports_, + sig); + num_event_imports_++; break; } } @@ -1955,10 +1955,10 @@ Result BinaryReader::ReadExportSection(Offset section_size) { ERROR_UNLESS(item_index < NumTotalGlobals(), "invalid export global index: %" PRIindex, item_index); break; - case ExternalKind::Except: - // Note: Can't check if index valid, exceptions section comes later. + case ExternalKind::Event: + // Note: Can't check if index valid, the event section comes later. ERROR_UNLESS(options_.features.exceptions_enabled(), - "invalid export exception kind: exceptions not allowed"); + "invalid export event kind: exceptions not allowed"); break; } @@ -2196,7 +2196,7 @@ Result BinaryReader::ReadSections() { case BinarySection::Event: ERROR_UNLESS(options_.features.exceptions_enabled(), "invalid section code: %u", section); - section_result = ReadExceptionSection(section_size); + section_result = ReadEventSection(section_size); result |= section_result; break; case BinarySection::DataCount: |