Skip to content

Instantly share code, notes, and snippets.

[ {
name: "outside",
reaches: [ "export-", "export-0", "export--0", "export-_", "export-$", "export-@", "export-~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./", "export-NaN", "export-Infinity", "export-if", "export-malloc", "export-_malloc", "export-__malloc", "export-a", "export-A", "export-\ufeff", "export-Å", "export-Å", "export-Å", "export-ffi", "export-ffi", "export-ffi", "export-\0\b", "export-", "export-", "export-€‚ƒ„", "export-‘’“”•–—˜™š›œžŸ", "export-￰￱￲￳￴￵￶￷", "export-￸�￾￿", "export-␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏", "export-␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟", "export-␠␡", "export-￰￱￲￳￴￵￶￷￸�", "export-‍", "export-‌", "export-͏", "export-⁠", "export-⵿", "export-𑁿", "export-᠎", "export-￯​ ­⁠ ‮‭", "export-‎‏‑", "export-", "export-⁡⁢⁣⁤", "export-𐀀󟿿􏿿", "export-Z̴͇̫̥̪͓͈͔͎̗̞̺̯̱̞̙̱̜̖̠̏͆̆͛͌͘͞ḁ̶̰̳̭͙̲̱̹̝͎̼͗ͨ̎̄̆͗̿̀́͟͡l̶̷͉̩̹̫̝͖̙̲̼͇͚͍̮͎̥̞̈́͊͗ͦ̈́ͫ̇́̚ͅͅg̶͕͔͚̩̓̐̅ͮ̔̐̎̂̏̾͊̍͋͊ͧ́̆ͦ͞o̡͋̔͐ͪͩ͏̢̧̫̙̤̮͖͙͓̺̜̩̼̘̠́", "export-ᅟᅠㅤᅠ", "export-︀", "export-︄", "export-󠄀", "export-󠇯", "export-̈", "export-", "export-␤", "export-", "export-",
diff --git a/src/passes/TypeSSA.cpp b/src/passes/TypeSSA.cpp
index 8ba6c10c4..e2bff86cd 100644
--- a/src/passes/TypeSSA.cpp
+++ b/src/passes/TypeSSA.cpp
@@ -85,22 +85,26 @@ std::vector<HeapType> ensureTypesAreInNewRecGroup(RecGroup recGroup,
std::unordered_set<HeapType> existingSet(existing.begin(), existing.end());
// Check for a collision with an existing rec group. Note that it is enough to
// check one of the types: either the entire rec group gets merged, so they
// are all merged, or not.
(module
(type (shared (array i8)))
(type (sub final (shared (array i8))))
(rec
(type (sub final (shared (array i8))))
)
(global (ref 0) (array.new_default 1 (i32.const 1)))
(global (ref 1) (array.new_default 2 (i32.const 1)))
(global (ref 2) (array.new_default 0 (i32.const 1)))
--- ok.wat 2024-05-15 09:49:22.761673972 -0700
+++ bad.wat 2024-05-15 09:49:52.181996721 -0700
@@ -300838,43 +300838,41 @@
(then
(local.set $12
(call $Zone._enter
(local.get $5)
)
)
)
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <pthread.h>
#include <emscripten.h>
#include <emscripten/threading.h>
#include <assert.h>
#if !defined(__EMSCRIPTEN_PTHREADS__) || __EMSCRIPTEN_PTHREADS__ != 1
#error __EMSCRIPTEN_PTHREADS__ should have been defined to be equal to 1 when building with pthreads support enabled!
var b;
b ||= typeof Module != 'undefined' ? Module : {};
var f = "object" == typeof window, g = "function" == typeof importScripts,
h = "object" == typeof process && "object" == typeof process.versions &&
"string" == typeof process.versions.node,
k = Object.assign({}, b), l = (a, c) => { throw c; }, m = "";
function n() {
var a = p;
return b.locateFile ? b.locateFile(a, m) : m + a
}
[
{
id: 'Block',
fields: [
{
form: 'CHILD_VECTOR',
name: 'list',
},
{
form: 'SCOPE_NAME_DEF',
@kripken
kripken / diff.diff
Created February 22, 2024 20:49
Binaryen wasm-opt.js pthreads build
diff --git a/CMakeLists.txt b/CMakeLists.txt
index def330b27..01ac747b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -336,12 +336,12 @@ if(EMSCRIPTEN)
add_link_flag("-sALLOW_MEMORY_GROWTH")
add_link_flag("-sSTACK_SIZE=5MB")
- if(EMSCRIPTEN_ENABLE_WASM_EH)
- add_compile_flag("-fwasm-exceptions")
// Auto-generated C API
// Block
BINARYEN_API BinaryenExpressionRef BinaryenBlockGetListAt(BinaryenExpressionRef expr, BinaryenIndex index);
// If
BINARYEN_API BinaryenExpressionRef BinaryenIfGetIfTrue(BinaryenExpressionRef expr);
BINARYEN_API BinaryenExpressionRef BinaryenIfGetCondition(BinaryenExpressionRef expr);
// Loop
@kripken
kripken / a.c
Last active February 1, 2024 22:20
#include <emscripten.h>
extern void launch_missiles();
extern void foo_checkin();
extern void bar_checkin();
void (*mutable_global)() = &launch_missiles;
void benign() {}