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 400
    • Issues 400
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2254
Closed
Open
Created Nov 24, 2020 by Artem Shinkarov@temaOwner

Internal error when upper bound of the fold-wl is out of range

/tmp|=> cat b.sac
int +(int a, int b) {return _add_SxS_ (a, b);}
int sum(int[.] a) {
  return with {
    ([0] <= iv <= _shape_A_ (a)): _sel_VxA_ (iv, a);
  }: fold (+, 0);
}

int main() {
  return sum([2,3]);
}

Dies with:

Internal compiler error
Assertion "cvidx[0] < SHgetExtent (shp, 0)" failed at /tmp/sac2c/src/libsac2c/constants/constants_struc_ops.c:56 -- Idx2Offset called with idx out of range
Please file a bug at: http://bugs.sac-home.org

I do realise that the the fold with-loop goes out of bounds, but this shouldn't be an internal error.

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