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

Using a native type as attribute in a class can crash de compiler #5139

Closed
p6rt opened this issue Feb 15, 2016 · 4 comments
Closed

Using a native type as attribute in a class can crash de compiler #5139

p6rt opened this issue Feb 15, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 15, 2016

Migrated from rt.perl.org#127548 (status was 'resolved')

Searchable as RT127548$

@p6rt
Copy link
Author

p6rt commented Feb 15, 2016

From @salortiz

use NativeCall; class MV is repr('CStruct') { has uint64 $.start; method s { if $!start {} } } # Fails

use NativeCall; class MV is repr('CStruct') { has uint64 $.start; method s { if +$!start {} } } # This works :/

From IRC​:

<sortiz> And the error message is totally uninformative!
<Skarsnik> duh
<Skarsnik> I don't even get why it does not work x)
<sortiz> Toke me hours to find the point of the error!
<jnthn> Odd, that's a compile-time failure even
<jnthn> sortiz​: Yeah, it's a crash during code-gen, bizzarely

@p6rt
Copy link
Author

p6rt commented Mar 2, 2016

From @jnthn

On Mon Feb 15 15​:31​:50 2016, sortiz wrote​:

use NativeCall; class MV is repr('CStruct') { has uint64 $.start;
method s { if $!start {} } } # Fails

use NativeCall; class MV is repr('CStruct') { has uint64 $.start;
method s { if +$!start {} } } # This works :/

From IRC​:

<sortiz> And the error message is totally uninformative!
<Skarsnik> duh
<Skarsnik> I don't even get why it does not work x)
<sortiz> Toke me hours to find the point of the error!
<jnthn> Odd, that's a compile-time failure even
<jnthn> sortiz​: Yeah, it's a crash during code-gen, bizzarely

Fixed the code-gen crash, and added tests in S12-attributes/native.t.

/jnthn

@p6rt
Copy link
Author

p6rt commented Mar 2, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Mar 2, 2016
@p6rt
Copy link
Author

p6rt commented Mar 2, 2016

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant