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

00210.c segfault at address 0x10 while tool run #360

Open
IngeniariusSoftware opened this issue Sep 10, 2022 · 0 comments
Open

00210.c segfault at address 0x10 while tool run #360

IngeniariusSoftware opened this issue Sep 10, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@IngeniariusSoftware
Copy link
Member

remove the test from the line if it fixed in the testcuite:
00087, 00088, 00089, 00124, 00159, 00189, 00209, 00210, 00216: TODO segfault at address 0x10 while tool run

tests:
https://github.com/c-testsuite/c-testsuite/blob/master/tests/single-exec/00210.c

typedef unsigned short uint16_t;
typedef unsigned char uint8_t;

typedef union Unaligned16a {
  uint16_t u;
  uint8_t b[2];
} __attribute__((packed)) Unaligned16a;

typedef union __attribute__((packed)) Unaligned16b {
  uint16_t u;
  uint8_t b[2];
} Unaligned16b;

extern void foo (void) __attribute__((stdcall));
void __attribute__((stdcall)) foo (void)
{
}

/* The actual attribute isn't important, must just be
   parsable.  */
#define ATTR __attribute__((__noinline__))
int ATTR actual_function() {
  return 42;
}

extern int printf (const char *, ...);
int main()
{
    void *function_pointer = &actual_function;

    int a = ((ATTR int(*) (void)) function_pointer)();
    printf("%i\n", a);

    /* In the following we once misparsed 'ATTR *' is a btype
       and hence the whole type was garbled.  */
    int b = ( (int(ATTR *)(void))  function_pointer)();
    printf("%i\n", b);

    return 0;
}
@IngeniariusSoftware IngeniariusSoftware added the bug Something isn't working label Sep 10, 2022
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