Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #34964] [PATCH] Fix some segfaults due to scalar.pmc/string.pmc

0 views
Skip to first unread message

Nick Glencross

unread,
Apr 13, 2005, 2:00:46 PM4/13/05
to bugs-bi...@rt.perl.org
# New Ticket Created by Nick Glencross
# Please include the string: [perl #34964]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34964 >


This patch fixes a few operations which are badly inherited by string
from scalar.pmc. increment/decrement have been removed as they aren't
really required for Strings. 'neg' also also suffered from a similar
problem, so this patch also stops this example segfaulting:

.sub test
new $P0, .String
$P0 = "12"
neg $P0
print $P0
print_newline
.end

You may need to do a make clean or similar to get string.c to be
properly built...(?)

[My feeling is that scalar should define set_integer_native,
set_number_native etc. to automatically morph, and then for integer,
float and string to override these to either not morph (for better
performance), or just do their own thing (i.e.
string::set_integer_native to convert the int to a String). That way you
can't get data being changed without its interpretation.]

scalar.patch

Jens Rieks

unread,
Apr 14, 2005, 9:25:12 AM4/14/05
to perl6-i...@perl.org
On Wednesday 13 April 2005 20:00, Nick Glencross wrote:
> # New Ticket Created by Nick Glencross
> # Please include the string: [perl #34964]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34964 >
>
>
> This patch fixes a few operations which are badly inherited by string
> from scalar.pmc. increment/decrement have been removed as they aren't
> really required for Strings. 'neg' also also suffered from a similar
> problem, so this patch also stops this example segfaulting:
>
> .sub test
> new $P0, .String
> $P0 = "12"
> neg $P0
> print $P0
> print_newline
> .end
Thanks, applied. Can someone please make a test from it?

> You may need to do a make clean or similar to get string.c to be
> properly built...(?)

Hmm, the old dependency-problems story :-(

> [My feeling is that scalar should define set_integer_native,
> set_number_native etc. to automatically morph, and then for integer,
> float and string to override these to either not morph (for better
> performance), or just do their own thing (i.e.
> string::set_integer_native to convert the int to a String). That way you
> can't get data being changed without its interpretation.]

jens

0 new messages