Skip to content

Instantly share code, notes, and snippets.

failed test: tests/testsuite/proposals/function-references/br_on_null.wast
Caused by:
unexpected token, expected one of: `func`, `extern`, `any`, `exn`, `eq`, `i31`, an index
--> tests/testsuite/proposals/function-references/br_on_null.wast:20:66
|
20 | (func (export "nullable-null") (result i32) (call $n (ref.null (type $t))))
| ^
failed test: tests/testsuite/proposals/function-references/br_table.wast
fn main() {
let n = 42;
println!("fib({}) = {}", n, fib(n));
}
fn fib(n: u32) -> u32 {
if n <= 2 {
1
} else {
fib(n - 1) + fib(n - 2)
; ModuleID = 'foo.3a1fbbbh-cgu.0'
source_filename = "foo.3a1fbbbh-cgu.0"
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
; Function Attrs: nounwind
define void @bar() unnamed_addr #0 {
start:
tail call void @inline_me()
ret void
fn hex_encode_fallback<'a>(src: &[u8], dst: &'a mut [u8]) -> Result<&'a str, usize> {
fn hex(byte: u8) -> u8 {
static TABLE: &[u8] = b"0123456789abcdef";
TABLE[byte as usize]
}
for (byte, slots) in src.iter().zip(dst.chunks_mut(2)) {
slots[0] = hex((*byte >> 4) & 0xf);
slots[1] = hex(*byte & 0xf);
}
JITDUMP specification version 2
Last Revised: 09/15/2016
Author: Stephane Eranian <[email protected]>
--------------------------------------------------------
| Revision | Date | Description |
--------------------------------------------------------
| 1 | 09/07/2016 | Initial revision |
--------------------------------------------------------
| 2 | 09/15/2016 | Add JIT_CODE_UNWINDING_INFO |
#![allow(warnings)]
#![crate_type = "rlib"]
use std::io::Read;
type Result<T> = std::result::Result<T, ()>;
pub struct TypeSectionReader<'a>(&'a ());
pub struct ImportSectionReader<'a>(&'a ());
pub struct ModuleSectionReader<'a>(&'a ());
--- before 2020-06-25 13:55:56.943297377 -0700
+++ after 2020-06-25 13:56:35.715449471 -0700
@@ -1,8 +1,8 @@
if value != null:
value.ref_count += 1
let current_elem = table[index]
+table[index] = value
if current_elem != null:
current_elem.ref_count -= 1
if current_elem.ref_count == 0:
--- before 2020-06-25 13:55:56.943297377 -0700
+++ after 2020-06-25 13:56:01.743316233 -0700
@@ -1,8 +1,8 @@
if value != null:
value.ref_count += 1
let current_elem = table[index]
+table[index] = value
if current_elem != null:
current_elem.ref_count -= 1
if current_elem.ref_count == 0:
use std::cell::RefCell;
use std::rc::Rc;
use wasmtime::*;
struct A {
table: Table,
put_the_thing: Rc<RefCell<Option<Val>>>,
contents: String,
}
use wasmtime::*;
struct A {
table: Table,
a: i32,
}
impl Drop for A {
fn drop(&mut self) {
let me = self.table.get(0).unwrap();