Open ghost opened 9 years ago
The latter half of section 6.10 of the specification describes the conditions for valid heap indexing expressions. One of them is:
ValidateExpression succeeds for expr with type intish;
intish
which should read
ValidateExpression succeeds for expr with a subtype of intish;
The following module, for example, is correctly accepted by OdinMonkey's validator:
(function(std, ffi, buff) { "use asm" var H32 = new std.Int32Array(buff) function f(x, y) { x = x|0 y = y|0 H32[x >> 2] = y } return f })
Note that the indexing expression x in H32[x >> 2] has type int <: intish.
x
H32[x >> 2]
int
The specification does not appeal to expression subsumption elsewhere, so this ought to be made explicit as a matter of consistency.
The latter half of section 6.10 of the specification describes the conditions for valid heap indexing expressions. One of them is:
which should read
The following module, for example, is correctly accepted by OdinMonkey's validator:
Note that the indexing expression
x
inH32[x >> 2]
has typeint
<:intish
.The specification does not appeal to expression subsumption elsewhere, so this ought to be made explicit as a matter of consistency.