Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/wasm/gc/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  bug1833681.js

  Sprache: JAVA
 

// When entering a block, stack types should be rewritten to the block's param type.
wasmFullPass(`(module
  (type $s (struct (field i32)))
  (type $a (array i32))
  (func (export "run") (result i32)
    (struct.new $s (i32.const 123))
    (array.new $a (i32.const 1) (i32.const 234))
    (block (param (ref null $s) (ref $a)) (result i32)
      (array.get $a (i32.const 0))
      drop
      struct.get $s 0
    )
  )
)`, 123);
wasmFailValidateText(`(module
  (type $s (struct (field i32)))
  (type $a (array i32))
  (func (export "run")
    (struct.new $s (i32.const 123))
    (array.new $a (i32.const 1) (i32.const 234))
    (block (param structref arrayref)
      (array.get $a (i32.const 0))
      drop
      struct.get $s 0
    )
  )
)`, /expression has type arrayref but expected \(ref null 1\)/);

// When exiting a block, stack types should be rewritten to the block's result type.
wasmFullPass(`(module
  (type $s (struct (field i32)))
  (type $a (array i32))
  (func (export "run") (result i32)
    (block (result (ref null $s) (ref $a))
      (struct.new $s (i32.const 123))
      (array.new $a (i32.const 1) (i32.const 234))
    )
    (array.get $a (i32.const 0))
    drop
    struct.get $s 0
  )
)`, 123);
wasmFailValidateText(`(module
  (type $s (struct (field i32)))
  (type $a (array i32))
  (func (export "run")
    (block (result structref arrayref)
      (struct.new $s (i32.const 123))
      (array.new $a (i32.const 1) (i32.const 234))
    )
    (array.get $a (i32.const 0)) ;; should not work without a downcast
    drop
    struct.get $s 0 ;; should not work without a downcast
    drop
  )
)`, /expression has type arrayref but expected \(ref null 1\)/);
wasmFailValidateText(`(module
  (type $s (struct (field i32)))
  (type $a (array i32))
  (func (export "run")
    (block (result structref arrayref)
      unreachable
      (array.new $a (i32.const 1) (i32.const 234))
    )
    (array.get $a (i32.const 0)) ;; should not work without a downcast
    drop
    struct.get $s 0 ;; should not work without a downcast
    drop
  )
)`, /expression has type arrayref but expected \(ref null 1\)/);

// local.tee should also respect subtypes.
wasmFailValidateText(`(module
  (type $s (struct (field i32)))
  (func (export "run")
    (local eqref)
    (struct.new $s (i32.const 123))
    local.tee 0
    struct.get $s 0
    drop
  )
)`, /expression has type eqref but expected \(ref null 0\)/);

Messung V0.5 in Prozent
C=97 H=100 G=98

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.