Skip to content

Fix array indexing in consts (broken by earlier const enum fixes) #4844

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

Merged
merged 2 commits into from
Feb 8, 2013

Conversation

jld
Copy link
Contributor

@jld jld commented Feb 8, 2013

Fixes #3169 and uses that to fix const array indexing, which I broke (in a way that doesn't break tests but will greatly confuse users) while trying to fix const enum vectors.

jld added 2 commits February 8, 2013 01:52
The number of operands of the LLVM node initializing the array
underlying a const vector isn't always the array length -- if the
array is of a sufficiently primitive type and all the elements' values
are known (or something like that), LLVM uses a specialized Constant
subclass that stores the data packed, and thus has no operands.  Oops.

But, because llsize_of now gives us a ConstantInt, we can just fix
rust-lang#3169 and this all goes away.
bors added a commit that referenced this pull request Feb 8, 2013
Fixes #3169 and uses that to fix const array indexing, which I broke (in a way that doesn't break tests but will greatly confuse users) while trying to fix const enum vectors.
@bors bors closed this Feb 8, 2013
@bors bors merged commit 9318bab into rust-lang:incoming Feb 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants