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

&uniname on Moar throws confusingly #3749

Closed
p6rt opened this issue Mar 22, 2015 · 4 comments
Closed

&uniname on Moar throws confusingly #3749

p6rt opened this issue Mar 22, 2015 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Mar 22, 2015

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

Searchable as RT124144$

@p6rt
Copy link
Author

p6rt commented Mar 22, 2015

From @peschwa

15​:45 < psch> m​: say uniname -1
15​:45 <+camelia> rakudo-moar 20ffd3​: OUTPUT«should eventually
  be unreachable␤ in sub uniname at
  src/gen/m-CORE.setting​:8670␤ in block <unit>
  at /tmp/B_LbZ96Xk_​:1␤␤»
15​:46 < psch> eventually... :)
[...]
15​:55 < masak> psch​: that's an LTA error message. please submit
  rakudobug

The issue seems to be in Moar, where MVM_unicode_get_name calls into MVM_codepoint_to_row_index, where the latter of those throws an AdHoc exception when its codepoint argument is < 0. (MoarVM/src/strings/unicode.c lines 42970 and 42269 respectively.) Modifying MVM_codepoint_to_row_index to return -1 would be one approach to fix this.

@p6rt
Copy link
Author

p6rt commented Apr 24, 2015

From @jnthn

On Sun Mar 22 09​:04​:47 2015, peschwa@​gmail.com wrote​:

15​:45 < psch> m​: say uniname -1
15​:45 <+camelia> rakudo-moar 20ffd3​: OUTPUT«should eventually
be unreachable␤ in sub uniname at
src/gen/m-CORE.setting​:8670␤ in block <unit>
at /tmp/B_LbZ96Xk_​:1␤␤»
15​:46 < psch> eventually... :)
[...]
15​:55 < masak> psch​: that's an LTA error message. please submit
rakudobug

The issue seems to be in Moar, where MVM_unicode_get_name calls into
MVM_codepoint_to_row_index, where the latter of those throws an AdHoc
exception when its codepoint argument is < 0.
(MoarVM/src/strings/unicode.c lines 42970 and 42269 respectively.)
Modifying MVM_codepoint_to_row_index to return -1 would be one
approach to fix this.

Added ranged checks now, so​:

say uniname(-1)
<illegal>
say uniname(0x210000)
<unassigned>

Also added tests in S15-unicode-information/uniname.t.

@p6rt
Copy link
Author

p6rt commented Apr 24, 2015

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

@p6rt
Copy link
Author

p6rt commented Apr 24, 2015

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

@p6rt p6rt closed this as completed Apr 24, 2015
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

No branches or pull requests

1 participant