Skip to content

va_arg cannot pass structs of union type or type with bit field correctly #705

@xxuejie

Description

@xxuejie

Please refer to this gist for the test source code: https://gist.github.com/4063456

This file works correctly when compiling directly using clang:

$ clang va-args-bug.c
$ ./a.out
The original address of a is: 0x12345678
The original type of b is: 9
The current address of a is: 0x12345678
The current type of b is: 9

But if we use emscripten to compile it, the results are not correct:

$ ./emcc va-args-bug.c
$ node a.out.js
The original address of a is: 0x12345678
The original type of b is: 9
The current address of a is: 0x10
The current type of b is: 24

This is very likely to be the reason of Issue #689. But I'm not 100% sure about this.

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