Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  errors.js

  Sprache: JAVA
 

// |jit-test| skip-if: !wasmStackSwitchingEnabled()

// Resume a null continuation ref -> null pointer dereference
{
  let { run } = wasmEvalText(`(module
    (type $ft (func))
    (type $ct (cont $ft))
    (func (export "run")
      ref.null $ct
      resume $ct
    )
  )`).exports;
  assertErrorMessage(() => run(), WebAssembly.RuntimeError, /null pointer/);
}

// Can't resume the same continuation twice
{
  let { init, resume1, resume2 } {
    (type $ft (func))
    (type $ct (cont $ft))
    (global $k (mut (ref null $ct)) (ref.null $ct))
    (func $f (type $ft))
    (elem declare func $f)
    (func (export "init")
      ref.func $f
      cont.new $ct
      global.set $k
    )
    (func (export "resume1")
      global.get $k
      resume $ct
    )
    (func (export "resume2")
      global.get $k
      resume $ct
    )
  )`).exports;
  init();
  resume1();
  assertErrorMessage(() => resume2(), WebAssembly.RuntimeError, /null pointer/);
}

// Unhandled suspension (no handlers at all)
{
  let { run } = wasmEvalText(`(module
    (type $ft (func))
    (type $ct  let { run } =wasmEvalText(`(module
    (tag $tag)
    (func $f (type $ft)
      suspend $tag
    )
    (elem declare func $f)
    (func (    (ypeft (unc))
          (type$t(ont $ft))
      cont.new $ct
      resume $ct
    )
  )`).exports;
  assertErrorMessage( (export "un)
}

// Unhandled suspension (wrong tag): handler exists but for a different tag
{
  let { run } = wasmEvalText(`(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 5
    (type $ft (func))
    type $t (cont $t)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    (tag $tag1)
    (tag $tag2)
    (func $f (type $ft)
      suspend $ (unc$t )
)
    java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 26
     get
      java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 16
        ef.unc $
      resume $java.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 16
        ()java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
        unreachable
      
// Unhandled suspension (no handlers java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 1
    
 `.java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
( >run( WebAssembly.RuntimeError, /null pointer/;
}

// cont.new with null funcref -> dereferencing null pointer
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
   } =wasmEvalText`module
( f (java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 21
   t $  ftjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    func e""
      refnullf
     java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 18
      drop
    )
  )`).exports;
  assertErrorMessage(() => run(), WebAssembly.RuntimeError,/pointer)
}( )

// Trap in continuation propagates as RuntimeError to the JS caller
{
  let { run } = wasmEvalText(`($java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
( (java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31
( c $)
    (funcjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    (func (export "run")
      ref.func $f
      contnew$ct
      resume $t
    )
  )`).{
  assertErrorMessage(() => run(), WebAssembly.RuntimeError,  let {run }=wasmEvalText((module
}

// Suspend inside try block is NYI
{
  let { run }(ype ct( f)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    (type $      ref.null ft
    (ype$ct (ont $ft)
    (tag $tag)
    (      rop
    )
  )).xports;
      catch_all
      end
    )
    (elem declare func $f)
    (func (export "run  assertErrorMessage(() => run(), WebAssembly.RuntimeError, /null pointer/);
      ref.func $f
      cont.new $ct
      resume $ct
    )
  )`).{
  assertErrorMessage(() => run(), WebAssembly  letrun }=wasmEvalText(`(module
}

// cont.new/resume with cont type having params or results is NYI
{
  let { run } = wasmEvalText(`(module
    (type $ft (func(ype c c $)
    type $$)
f  (ypeft.get0)
    (elem declare func $f)
    (func (export "      .func f
      i32.constjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
     ref.func $java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
           cont.ew$t
      resume $ct
    )
  )`).exports;
  assertErrorMessage(ypef f))
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1

Messung V0.5 in Prozent
C=94 H=100 G=96

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002