Skip to content

Instantly share code, notes, and snippets.

Alex Crichton alexcrichton

View GitHub Profile
View a.rs
#![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 ());
View foo.diff
--- 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:
View gist:be7378c30c70195b7fca7eed9054eb40
--- 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:
View main.rs
use std::cell::RefCell;
use std::rc::Rc;
use wasmtime::*;
struct A {
table: Table,
put_the_thing: Rc<RefCell<Option<Val>>>,
contents: String,
}
View main.rs
use wasmtime::*;
struct A {
table: Table,
a: i32,
}
impl Drop for A {
fn drop(&mut self) {
let me = self.table.get(0).unwrap();
View bar.ll
; ModuleID = 'bar.3a1fbbbh-cgu.0'
source_filename = "bar.3a1fbbbh-cgu.0"
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"
$__rust_panic_type_info = comdat any
@"??_7type_info@@6B@" = external global i8*
@__rust_panic_type_info = linkonce_odr global { i8**, i8*, [11 x i8] } { i8** @"??_7type_info@@6B@", i8* null, [11 x i8] c"rust_panic\00" }, comdat
View a.rs
pub struct Parser {
// internally has a state machine which looks like:
//
// * parsing a section - in this state we're looking for the section header
// which indicates the section code and how big the section is. Depending
// on the section code this will indicate what form of chunk is returned.
// This also waits for some sections to be entirely resident before
// proceeding.
//
// * parsing functions - this has a count of how many functions are
View main.go
package main
// #include <assert.h>
// #include <signal.h>
// #include <sys/mman.h>
//
// #define ALT_STACK_SIZE (16 * 4096)
//
// void my_run() {
// void *stack = mmap(NULL, ALT_STACK_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
View foo
+ [ -z arm-unknown-linux-gnueabihf ]
+ run arm-unknown-linux-gnueabihf
+ docker build -t backtrace -f ci/docker/arm-unknown-linux-gnueabihf/Dockerfile ci
Sending build context to Docker daemon 32.26kB
Step 1/3 : FROM ubuntu:20.04
---> 1d622ef86b13
Step 2/3 : RUN apt-get update && apt-get install -y --no-install-recommends gcc ca-certificates libc6-dev gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user
---> Using cache
---> 3b0e9e7b0675
Step 3/3 : ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf"
View foo.diff
--- before.wast 2020-06-09 12:49:42.448000829 -0700
+++ tests/local/module-linking/a.wast 2020-06-09 12:50:29.456176376 -0700
@@ -3,42 +3,42 @@
;; boilerplate, it is proportional in size to only the *direct* dependencies.
(module $A
- (type $Wasi (instance ...))
+ (type $Wasi (instance ))
(import "wasi" (instance (type $Wasi)))
- (func (export "a") ...)
You can’t perform that action at this time.