Skip to content

Commit 844f45c

Browse files
committed
more
1 parent 8636c99 commit 844f45c

5 files changed

+35
-1935
lines changed

src/wasm/wasm-type.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,7 @@ Type::Type(std::initializer_list<Type> types) { init(types); }
125125

126126
Type::Type(const std::vector<Type>& types) { init(types); }
127127

128-
size_t Type::size() const {
129-
if (id <= unreachable) {
130-
return 0;
131-
}
132-
return expand().size();
133-
}
128+
size_t Type::size() const { return expand().size(); }
134129

135130
const std::vector<Type>& Type::expand() const {
136131
std::shared_lock<std::shared_timed_mutex> lock(mutex);

src/wasm/wasm-validator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ void FunctionValidator::visitLocalSet(LocalSet* curr) {
759759
"local.set index must be small enough");
760760
if (curr->value->type != unreachable) {
761761
if (curr->type != none) { // tee is ok anyhow
762-
shouldBeEqualOrFirstIsUnreachable(
762+
shouldLeftBeSubTypeOfRightOrUnreachable(
763763
curr->value->type,
764764
curr->type,
765765
curr,

test/example/c-api-kitchen-sink.txt

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3863,31 +3863,6 @@ int main() {
38633863
expressions[744] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
38643864
{
38653865
BinaryenExpressionRef operands[] = { expressions[14], expressions[15], expressions[16], expressions[17] };
3866-
<<<<<<< HEAD
3867-
expressions[743] = BinaryenCallIndirect(the_module, expressions[742], operands, 4, "iiIfF");
3868-
}
3869-
expressions[744] = BinaryenUnary(the_module, 20, expressions[743]);
3870-
expressions[745] = BinaryenLocalGet(the_module, 0, 2);
3871-
expressions[746] = BinaryenDrop(the_module, expressions[745]);
3872-
expressions[747] = BinaryenConst(the_module, BinaryenLiteralInt32(101));
3873-
expressions[748] = BinaryenLocalSet(the_module, 0, expressions[747]);
3874-
expressions[749] = BinaryenConst(the_module, BinaryenLiteralInt32(102));
3875-
expressions[750] = BinaryenLocalTee(the_module, 0, expressions[749], 2);
3876-
expressions[751] = BinaryenDrop(the_module, expressions[750]);
3877-
expressions[752] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
3878-
expressions[753] = BinaryenLoad(the_module, 4, 0, 0, 0, 2, expressions[752]);
3879-
expressions[754] = BinaryenConst(the_module, BinaryenLiteralInt32(8));
3880-
expressions[755] = BinaryenLoad(the_module, 2, 1, 2, 1, 3, expressions[754]);
3881-
expressions[756] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
3882-
expressions[757] = BinaryenLoad(the_module, 4, 0, 0, 0, 4, expressions[756]);
3883-
expressions[758] = BinaryenConst(the_module, BinaryenLiteralInt32(9));
3884-
expressions[759] = BinaryenLoad(the_module, 8, 0, 2, 8, 5, expressions[758]);
3885-
expressions[760] = BinaryenStore(the_module, 4, 0, 0, expressions[30], expressions[31], 2);
3886-
expressions[761] = BinaryenStore(the_module, 8, 2, 4, expressions[32], expressions[33], 3);
3887-
expressions[762] = BinaryenSelect(the_module, expressions[27], expressions[28], expressions[29]);
3888-
expressions[763] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
3889-
expressions[764] = BinaryenReturn(the_module, expressions[763]);
3890-
=======
38913866
expressions[745] = BinaryenCallIndirect(the_module, expressions[744], operands, 4, "iiIfF");
38923867
}
38933868
expressions[746] = BinaryenUnary(the_module, 20, expressions[745]);
@@ -3896,7 +3871,7 @@ int main() {
38963871
expressions[749] = BinaryenConst(the_module, BinaryenLiteralInt32(101));
38973872
expressions[750] = BinaryenLocalSet(the_module, 0, expressions[749]);
38983873
expressions[751] = BinaryenConst(the_module, BinaryenLiteralInt32(102));
3899-
expressions[752] = BinaryenLocalTee(the_module, 0, expressions[751]);
3874+
expressions[752] = BinaryenLocalTee(the_module, 0, expressions[751], 2);
39003875
expressions[753] = BinaryenDrop(the_module, expressions[752]);
39013876
expressions[754] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
39023877
expressions[755] = BinaryenLoad(the_module, 4, 0, 0, 0, 2, expressions[754]);
@@ -3911,7 +3886,6 @@ int main() {
39113886
expressions[764] = BinaryenSelect(the_module, expressions[27], expressions[28], expressions[29], BinaryenTypeAuto());
39123887
expressions[765] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
39133888
expressions[766] = BinaryenReturn(the_module, expressions[765]);
3914-
>>>>>>> Add support for reference types proposal
39153889
{
39163890
BinaryenExpressionRef operands[] = { expressions[10], expressions[11], expressions[12], expressions[13] };
39173891
expressions[767] = BinaryenReturnCall(the_module, "kitchen()sinker", operands, 4, 2);

0 commit comments

Comments
 (0)