Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static_h: Assertion `Val && "isa<> used on a null pointer"' failed with -typed on tsc.js #1321

Closed
jakebailey opened this issue Feb 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jakebailey
Copy link

Bug Description

Hermes git revision (if applicable): 208adbf
OS: Ubuntu 22.04 on WSL2
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): x86_64

Steps To Reproduce

Running shermes on tsc.js using the same command used in the ffe examples:

$ ~/work/hermes-build/bin/shermes -typed -exec ~/work/TypeScript/built/local/tsc.js
shermes: /home/jabaile/work/hermes/external/llvh/include/llvh/Support/Casting.h:106: static bool llvh::isa_impl_cl<To, const From*>::doit(const From*) [with To = hermes::flow::ClassType; From = hermes::flow::TypeInfo]: Assertion `Val && "isa<> used on a null pointer"' failed.
[1]    46223 IOT instruction  ~/work/hermes-build/bin/shermes -typed -exec 

Obviously I am not expecting this to work out of the box, but it sounds like there's something wrong here.

The Expected Behavior

No crash, some other error. Running without -typed gives more reasonable errors, like:

/home/jabaile/work/TypeScript/src/compiler/debug.ts:859:16: [original] warning: the variable "console" was not declared in function "printControlFlowGraph"
/home/jabaile/work/TypeScript/built/local/tsc.js:1904:12: [transpiled] warning: the variable "console" was not declared in function "printControlFlowGraph"
    return console.log(formatControlFlowGraph(flowNode));
           ^~~~~~~
/home/jabaile/work/TypeScript/src/compiler/performanceCore.ts:88:58: [original] warning: the variable "require" was not declared in function "tryGetNodePerformanceHooks"
/home/jabaile/work/TypeScript/built/local/tsc.js:2586:88: [transpiled] warning: the variable "require" was not declared in function "tryGetNodePerformanceHooks"
      const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");

/home/jabaile/work/TypeScript/src/compiler/semver.ts:46:8: [original] error: Invalid expression encountered
/home/jabaile/work/TypeScript/built/local/tsc.js:2268:16: [transpiled] error: Invalid expression encountered
var _Version = class _Version {

... a few more things
@jakebailey jakebailey added the bug Something isn't working label Feb 22, 2024
@avp
Copy link
Contributor

avp commented Feb 22, 2024

Looks like this is due to our inconsistent handling of ClassExpression, which we don't fully support yet (only ClassDeclaration for typed classes at the moment).

Obviously we shouldn't fail with an assert, we'll look into fixing it. Thanks for the report.

@avp
Copy link
Contributor

avp commented Feb 23, 2024

4a1997a makes the errors actually output instead of asserting.

@avp avp closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants