Skip to content

Commit a9c001a

Browse files
authored
Rename except_ref type to exnref (#1142)
In WebAssembly/exception-handling#79 we agreed to rename except_ref type to exnref.
1 parent 51c0506 commit a9c001a

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

src/binary-reader.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ bool BinaryReader::IsConcreteType(Type type) {
384384
case Type::V128:
385385
return options_.features.simd_enabled();
386386

387-
case Type::ExceptRef:
387+
case Type::Exnref:
388388
return options_.features.exceptions_enabled();
389389

390390
case Type::Anyref:

src/common.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,18 @@ struct Location {
207207

208208
// Matches binary format, do not change.
209209
enum class Type : int32_t {
210-
I32 = -0x01, // 0x7f
211-
I64 = -0x02, // 0x7e
212-
F32 = -0x03, // 0x7d
213-
F64 = -0x04, // 0x7c
214-
V128 = -0x05, // 0x7b
215-
Funcref = -0x10, // 0x70
216-
Anyref = -0x11, // 0x6f
217-
ExceptRef = -0x18, // 0x68
218-
Func = -0x20, // 0x60
219-
Void = -0x40, // 0x40
220-
___ = Void, // Convenient for the opcode table in opcode.h
221-
Any = 0, // Not actually specified, but useful for type-checking
210+
I32 = -0x01, // 0x7f
211+
I64 = -0x02, // 0x7e
212+
F32 = -0x03, // 0x7d
213+
F64 = -0x04, // 0x7c
214+
V128 = -0x05, // 0x7b
215+
Funcref = -0x10, // 0x70
216+
Anyref = -0x11, // 0x6f
217+
Exnref = -0x18, // 0x68
218+
Func = -0x20, // 0x60
219+
Void = -0x40, // 0x40
220+
___ = Void, // Convenient for the opcode table in opcode.h
221+
Any = 0, // Not actually specified, but useful for type-checking
222222
};
223223
typedef std::vector<Type> TypeVector;
224224

@@ -377,8 +377,8 @@ static WABT_INLINE const char* GetTypeName(Type type) {
377377
return "funcref";
378378
case Type::Func:
379379
return "func";
380-
case Type::ExceptRef:
381-
return "except_ref";
380+
case Type::Exnref:
381+
return "exnref";
382382
case Type::Void:
383383
return "void";
384384
case Type::Any:
@@ -412,7 +412,7 @@ static WABT_INLINE TypeVector GetInlineTypeVector(Type type) {
412412
case Type::V128:
413413
case Type::Funcref:
414414
case Type::Anyref:
415-
case Type::ExceptRef:
415+
case Type::Exnref:
416416
return TypeVector(&type, &type + 1);
417417

418418
default:

src/type-checker.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ Result TypeChecker::OnBrIf(Index depth) {
385385
}
386386

387387
Result TypeChecker::OnBrOnExn(Index depth, const TypeVector& types) {
388-
Result result = PopAndCheck1Type(Type::ExceptRef, "br_on_exn");
388+
Result result = PopAndCheck1Type(Type::Exnref, "br_on_exn");
389389
Label* label;
390390
CHECK_RESULT(GetLabel(depth, &label));
391391
if (Failed(CheckTypes(types, label->br_types()))) {
@@ -394,7 +394,7 @@ Result TypeChecker::OnBrOnExn(Index depth, const TypeVector& types) {
394394
TypesToString(types).c_str());
395395
result = Result::Error;
396396
}
397-
PushType(Type::ExceptRef);
397+
PushType(Type::Exnref);
398398
return result;
399399
}
400400

@@ -481,7 +481,7 @@ Result TypeChecker::OnCatch() {
481481
ResetTypeStackToLabel(label);
482482
label->label_type = LabelType::Catch;
483483
label->unreachable = false;
484-
PushType(Type::ExceptRef);
484+
PushType(Type::Exnref);
485485
return result;
486486
}
487487

@@ -663,7 +663,7 @@ Result TypeChecker::OnRefIsNullExpr() {
663663
}
664664

665665
Result TypeChecker::OnRethrow() {
666-
Result result = PopAndCheck1Type(Type::ExceptRef, "rethrow");
666+
Result result = PopAndCheck1Type(Type::Exnref, "rethrow");
667667
CHECK_RESULT(SetUnreachable());
668668
return result;
669669
}

test/parse/expr/bad-try-sig-multi.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
i32.const 1
88
i32.const 2
99
catch
10-
drop ;; drop except_ref
10+
drop ;; drop exnref
1111
i32.const 3
1212
i32.const 4
1313
end
@@ -18,7 +18,7 @@
1818
try (param i32)
1919
drop
2020
catch
21-
drop ;; drop except_ref
21+
drop ;; drop exnref
2222
end
2323
return))
2424
(;; STDERR ;;;

test/parse/expr/try-multi.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
try (param i32) (result i32)
2020
i32.eqz
2121
catch
22-
drop ;; no i32 param, just except_ref
22+
drop ;; no i32 param, just exnref
2323
i32.const 0
2424
end
2525
return)

test/typecheck/bad-br_on_exn-mismatch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
br_on_exn 0 $e
99
drop))
1010
(;; STDERR ;;;
11-
out/test/typecheck/bad-br_on_exn-mismatch.txt:8:5: error: type mismatch in br_on_exn, expected [except_ref] but got [i32]
11+
out/test/typecheck/bad-br_on_exn-mismatch.txt:8:5: error: type mismatch in br_on_exn, expected [exnref] but got [i32]
1212
br_on_exn 0 $e
1313
^^^^^^^^^
1414
;;; STDERR ;;)

test/typecheck/bad-br_on_exn-result-mismatch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
br_on_exn 0 $e
1010
end))
1111
(;; STDERR ;;;
12-
out/test/typecheck/bad-br_on_exn-result-mismatch.txt:8:5: error: type mismatch in try catch, expected [] but got [except_ref]
12+
out/test/typecheck/bad-br_on_exn-result-mismatch.txt:8:5: error: type mismatch in try catch, expected [] but got [exnref]
1313
catch
1414
^^^^^
1515
;;; STDERR ;;)

0 commit comments

Comments
 (0)