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

[query] Fix bad tuple indexing on PCanonicalBaseStructSettable #8799

Merged
merged 9 commits into from May 15, 2020

Conversation

johnc1231
Copy link
Contributor

@johnc1231 johnc1231 commented May 14, 2020

This should fix Julia's bug here: https://discuss.hail.is/t/arrayindexoutofboundsexception-error-in-hail-0-2-40/1413/11

I will make a follow up PR tomorrow splitting things up and making a PCanonicalTupleCode. I just wanted to get rid of this blatantly wrong thing.

@@ -242,23 +242,30 @@ class PCanonicalBaseStructSettable(

def settableTuple(): IndexedSeq[Settable[_]] = FastIndexedSeq(a)

def loadField(cb: EmitCodeBuilder, fieldIdx: Int): IEmitCode = {
def loadField(cb: EmitCodeBuilder, i: Int): IEmitCode = {
val ptTuple = pt.asInstanceOf[PTuple]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the wrong fix. PCBaseStructSettable doesn't seem broken -- the fieldIdx here should just be base struct index, not tuple index.

The fix should be to use the true index here:

Looks like Chris's PR that moved a bunch of Emit to IEmit broke this on 4/22.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok that's a better idea. One sec

@johnc1231
Copy link
Contributor Author

Fixed! Thanks.

@johnc1231 johnc1231 added the WIP label May 15, 2020
@johnc1231
Copy link
Contributor Author

Added WIP because about to push fixes that still have some debugging info floating around

@johnc1231 johnc1231 removed the WIP label May 15, 2020
@johnc1231 johnc1231 mentioned this pull request May 15, 2020
@danking danking merged commit 42fb197 into hail-is:master May 15, 2020
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.

None yet

3 participants