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

[AOT] Avoid call_extern() with incorrect argument count #15301

Merged
merged 1 commit into from
Jul 18, 2023

Commits on Jul 12, 2023

  1. [AOT] Avoid call_extern() with incorrect argument count

    Prior to this commit, if device initialization is required, the AOT
    main function produced a `call_extern()` that included the device
    context as input.  This commit updates the AOT main function to
    provide the device context only if the function being called accepts a
    device context as input.
    
    If an extra device context argument is included at the call site, the
    C codegen would produce a function signature that includes the device
    context for the caller's compilation unit, but a signature without the
    device context for the callee's compilation unit.  While this can
    compile and run in some cases, it is undefined behavior for the
    signature to vary between compilation units, and should be avoided.
    
    This was initially discovered while debugging
    apache#14985, in which changes to the
    lowering flow resulted in the caller and callee being within the same
    compilation unit.
    Lunderberg committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    3b5d135 View commit details
    Browse the repository at this point in the history