Skip to content

internal check macros don't work #19503

Description

@targos

This code:

CHECK_NE(addressType, undefined);

Is transformed to:

CHECK((addressType) !== (undefined));

This results in a runtime ReferenceError: CHECK is not defined. Macros should be expanded recursively.

/cc @devsnek

Activity

  1. devsnek commented on Mar 21, 2018

    @devsnek
    Member

    @targos interesting, I didn't observe that behaviour while testing. as it is the code is taken from v8's JS2C script so I don't know much about its specific workings. I can try to take a look later today.

  2. devsnek commented on Mar 23, 2018

    @devsnek
    Member

    @targos i can't reproduce this.

  3. BridgeAR commented on Apr 12, 2018

    @BridgeAR
    Member

    I just checked this and I am able to reproduce the problem.

    CHECK(condition);
    CHECK_EQ(condition, true);
    DCHECK(condition);
    DCHECK_EQ(condition, true);
    // Becomes
    do { if (!(condition)) (process._rawDebug("CHECK: condition == true"), process.abort()) } while (0);
    CHECK((condition) === (true));
    void(condition);
    void(condition, true);
  4. devsnek commented on Apr 12, 2018

    @devsnek
    Member

    i'm still unable to reproduce this 😕

  5. BridgeAR commented on Apr 12, 2018

    @BridgeAR
    Member

    How did you try to reproduce this so far?

  6. devsnek commented on Apr 12, 2018

    @devsnek
    Member

    I tried your inputs above but got the expected results out.

  7. targos commented on Apr 19, 2018

    @targos
    MemberAuthor

    I still have this problem.

    Can you try to reproduce with the following branch?
    https://github.com/targos/node/tree/net-check-family

    $ out/Release/node test/parallel/test-http-localaddress-bind-error.js
    net.js:884
        CHECK((addressType) !== (undefined));
        ^
    
    ReferenceError: CHECK is not defined
        at internalConnect (net.js:884:5)
        at defaultTriggerAsyncIdScope (internal/async_hooks.js:294:19)
        at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1080:9)
        at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:55:10)
    
  8. jasnell commented on Aug 11, 2018

    @jasnell
    Member

    Ping @targos ... is this still an issue for you? I'm unable to reproduce.

  9. apapirovski commented on Oct 26, 2018

    @apapirovski
    Contributor

    Given the lack of a follow up, I'm going to close this out. Please feel free to reopen if you believe I've made a mistake and this is still an existing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions