Skip to content

'assertion failed: !ptr.is_null()' on asmjs-unknown-emscripten #307

Closed
@sunng87

Description

@sunng87

I was in progress porting handlebars to webassembly. And got this issue, only on asmjs and wasm32.

thread 'main' panicked at 'assertion failed: !ptr.is_null()', /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libpanic_unwind/emcc.rs:33
note: Run with `RUST_BACKTRACE=1` for a backtrace.

/home/nsun/tmp/hbs-test/target/asmjs-unknown-emscripten/debug/hbs-test.js:110
      throw ex;
      ^
5390400

Here is a minimum source file to reproduce this issue:

    let replace = Regex::new(">|<|\"|&").unwrap();
    let result = replace.replace_all("<html>", |cap: &Captures| {
        match cap.at(0) {
            Some("<") => "&lt;".to_owned(),
            Some(">") => "&gt;".to_owned(),
            Some("\"") => "&quot;".to_owned(),
            Some("&") => "&amp;".to_owned(),
            _ => "".to_owned(),
        }
    });
    println!("{}", result);

My rustc: rustc 1.15.0-nightly (71c06a56a 2016-12-18)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions