Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 17
    • Merge requests 17
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2252
Closed
Open
Created May 19, 2020 by Artem Shinkarov@temaOwner

Typechecker goes nuts

Something really weird is happening when typechecking the following trivial program:

int id (int x) { return x; }
int main () { return id ((1, (1, 1))); }

sac2c dies at:

**  6: Running type inference system ...
  **** Enforcing Specializations ...
  **** Running type inference system ...


OOOOOOOPS, your program crashed the compiler 8-((

Backtrace suggests that:

0x00007ffff7af9325 in TYisProd (type=0x0)
    at /tmp/sac2c/src/libsac2c/typecheck/new_types.c:3480
3480	     DBUG_RETURN (NTYPE_CON (type) == TC_prod);
(gdb) backtrace 
#0  0x00007ffff7af9325 in TYisProd (type=0x0)
    at /tmp/sac2c/src/libsac2c/typecheck/new_types.c:3480
#1  0x00007ffff7afafc4 in TYeliminateAlpha (t1=0x0)
    at /tmp/sac2c/src/libsac2c/typecheck/new_types.c:4153

Could it be that (1, (1, 1)) is treated as a tuple by some reason?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking