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 414
    • Issues 414
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2549
Closed
Open
Created Feb 18, 2026 by Quinten Cabo@QuintenDeveloper

Varargs function breaks type patterns

/**********************************************************************
 *
 * SAC bug report: varargs.sacbugreport
 *
 **********************************************************************
 *
 * Automatically generated on wo 18 feb 2026 11:14:36 CET
 *
 * using sac2c 2.1.0-PuurGeluk-211-gdb91
 * built 2026-02-18T11:02:40.
 * by user qc on host pop-os.
 *
 * The compiler was called by
 * /home/qc/sac2c/src/cmake-build-debug/sac2c_d varargs.sac -check p
 *
 * The compiler crashed in
 *  phase: pretp (Preprocessing type patterns)
 *  sub phase: rtpe (Turning type patterns of externals into code)
 *
 * What follows is the contents of varargs.sac.
 *
 **********************************************************************/
external int dots(int[*] unused, ...);

int main() {
    b = dots([1], [2]);
    return 0;
}

I got the following error message.

**  1: Loading SAC program ...
**  2: Preprocessing type patterns ...
/home/qc/sac2c/src/libsac2c/typepattern/type_pattern_resolve.c:1386:17: runtime error: member access within null pointer of type 'struct node'

I think the problem is that the external function has no pragma at all.

Edited Feb 18, 2026 by Quinten Cabo
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking