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

Const arrays, and fuzzing of array constructors #883

Merged
merged 1 commit into from
Feb 25, 2020

Conversation

afd
Copy link
Contributor

@afd afd commented Feb 23, 2020

This change does two things:

(1) It corrects the way that qualifiers (in particular const) are
interpreted when applied to array types. A declaration:

const int v[2] = ...;

should be regarded as having type:

QualifiedType(ArrayType(int, 2), CONST)

but was being regarded as having type:

ArrayType(QualifiedType(int, CONST), 2)

(2) It changes the way array constructor expressions are fuzzed.
Previously, an array constructor for an array of size 256 was fuzzed
by trying to make 256 distinct expressions. The chances of the fuzzer
getting stuck and generating a "fuzzed into a corner" exception were
very high in such cases. This change uses an approach with a much
lower probability of failure, whereby a number of element constructor
expressions are generated and then re-used several times at random if
there are not enough to provide a value for every element of the
array.

@afd afd merged commit 72fda8f into master Feb 25, 2020
@afd afd deleted the fuzzing-of-array-constructors branch February 25, 2020 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants