Skip to content

Recognize global variables as array bounds #533

@john-h-kastner

Description

@john-h-kastner

This is a pattern I've noticed 3c bounds inference doesn't support while converting yacr2

extern int baz;
void foo(int *a) {
  for (int i = 0; i < baz; i++) {
    (void) a[i];
  }
}

Here baz is being used as the length of a, so I would like to get _Array_ptr<int> a : count(baz). This is the result we see if baz is instead a parameter of foo.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions