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

[Truffle] Don't taint from self in String#[](String). #2780

Merged
merged 1 commit into from Mar 30, 2015

Conversation

nirvdrum
Copy link
Contributor

@chrisseaton @eregon This is one of the proposed solutions for dealing with the need to skip tainting for certain specializations. I don't particularly like using exceptions this way, but using a wrapper object would likely add much greater overhead. The third alternative is to not use the CoreMethod option for tainting at all, but rather have each specialization that needs it use the TaintResultNode in place; this seems both error-prone (easy to forget one) and verbose.

I'm doing this as a PR to get feedback. No hard feelings if you think this is terrible.

@chrisseaton
Copy link
Contributor

You could parameterise the exception - DoNotTaint<RubyString> - won't add anything but looks neater I think.

I don't mind the exception - they compile to a jump and using exceptions is idiomatic Truffle - unlike in normal Java code so no need to feel dirty. I guess an exception also simplifies the interaction with the DSL?

I think a wrapper object would also be fine. Neither adds any peak runtime overhead.

@eregon
Copy link
Member

eregon commented Mar 30, 2015

Looks good to me as the exception is contained in the TaintResultNode.

@nirvdrum
Copy link
Contributor Author

This was news to me, but generic classes can't extend java.lang.Throwable.

@chrisseaton
Copy link
Contributor

Ah yeah, I have come across that before. nm

nirvdrum added a commit that referenced this pull request Mar 30, 2015
[Truffle] Don't taint from self in String#[](String).
@nirvdrum nirvdrum merged commit 1d8dc06 into master Mar 30, 2015
@nirvdrum nirvdrum deleted the truffle_taint_exemptions branch March 30, 2015 17:16
@chrisseaton chrisseaton modified the milestone: truffle-dev May 4, 2015
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
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

4 participants