File tree Expand file tree Collapse file tree 3 files changed +26
-19
lines changed Expand file tree Collapse file tree 3 files changed +26
-19
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ It decodes into a vector of :ref:`element segments <syntax-elem>` that represent
378
378
379
379
.. note ::
380
380
The initial integer can be interpreted as a bitfield.
381
- Bit 0 indicates a passive or declarative segment,
381
+ Bit 0 distinguishes a passive or declarative segment from an active segment,
382
382
bit 1 indicates the presence of an explicit table index for an active segment and otherwise distinguishes passive from declarative segments,
383
383
bit 2 indicates the use of element type and element :ref: `expressions <binary-expr >` instead of element kind and element indices.
384
384
Original file line number Diff line number Diff line change 237
237
" (import \"\" \"\" (memory $foo 1))"
238
238
" (import \"\" \"\" (memory $foo 1))" )
239
239
" duplicate memory" )
240
+
241
+ ;; Test that exporting random globals does not change a memory's semantics.
242
+
243
+ (module
244
+ (memory (export " memory" ) 1 1 )
245
+
246
+ ;; These should not change the behavior of memory accesses.
247
+ (global (export " __data_end" ) i32 (i32.const 10000 ))
248
+ (global (export " __stack_top" ) i32 (i32.const 10000 ))
249
+ (global (export " __heap_base" ) i32 (i32.const 10000 ))
250
+
251
+ (func (export " load" ) (param i32 ) (result i32 )
252
+ (i32.load8_u (local.get 0 ))
253
+ )
254
+ )
255
+
256
+ ;; None of these memory accesses should trap.
257
+ (assert_return (invoke " load" (i32.const 0 )) (i32.const 0 ))
258
+ (assert_return (invoke " load" (i32.const 10000 )) (i32.const 0 ))
259
+ (assert_return (invoke " load" (i32.const 20000 )) (i32.const 0 ))
260
+ (assert_return (invoke " load" (i32.const 30000 )) (i32.const 0 ))
261
+ (assert_return (invoke " load" (i32.const 40000 )) (i32.const 0 ))
262
+ (assert_return (invoke " load" (i32.const 50000 )) (i32.const 0 ))
263
+ (assert_return (invoke " load" (i32.const 60000 )) (i32.const 0 ))
264
+ (assert_return (invoke " load" (i32.const 65535 )) (i32.const 0 ))
You can’t perform that action at this time.
0 commit comments