01:48 ilbot3 joined 04:40 zostay joined 04:48 JimmyZ joined 06:29 brrt joined
brrt good * 06:29
turns out a one-hour commute is just a bit too short for work 06:30
06:39 domidumont joined 06:45 domidumont joined 06:50 nine joined
brrt o/ nine 06:56
06:57 domidumont joined
nine Good morning! 06:59
Seems like I fat fingered ctrl+d last night and instead suspended irssi so it lost all connections over night
moritz \o nine. Yes, d and s are right next to each other :/ 07:08
nine Good thing we have irclog.perlgeek.de :) Thanks for that! 07:10
07:36 zakharyas joined
jnthn timotimo: A bounds check there seems sane...I'm surprised we didn't already ahve one 08:25
*have
timotimo: Especially since spesh can safely turn getattr into pointer derefs too
08:29 brrt joined 08:34 vendethiel joined 09:03 nine joined, mtj_ joined, nwc10 joined 09:27 domidumont joined 09:47 brrt joined
timotimo jnthn: but what if the wrong hint had actually been in bounds? 10:43
jnthn timotimo: Then we'd hand back a bogus attribute :) 10:55
timotimo: That's not a MoarVM problem though, that's an NQP code-gen problem
The MoarVM bug is that we don't bounds check 10:56
timotimo m: class Test { has $!foo = 100; has $!bar = "whoa"; method burp { return Proxy.new(STORE => method omg(*@) { say $!foo; say $!bar }, FETCH => method omg2(*@) { say $!foo; say $!bar } }; Test.new().burp() = 10
camelia rakudo-moar f0e6ae: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> ethod omg2(*@) { say $!foo; say $!bar } ⏏}; Test.new().burp() = 10␤ expecting any of:␤ post…»
timotimo m: class Test { has $!foo = 100; has $!bar = "whoa"; method burp { return Proxy.new(STORE => method omg(*@) { say $!foo; say $!bar }, FETCH => method omg2(*@) { say $!foo; say $!bar }) }; Test.new().burp() = 10
camelia rakudo-moar f0e6ae: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> ; say $!bar }) }; Test.new().burp() = 10⏏<EOL>␤ expecting any of:␤ statement end␤ statement modifier␤ statement modifier loop␤»
timotimo m: class Test { has $!foo = 100; has $!bar = "whoa"; method burp { return Proxy.new(STORE => method omg(*@) { say $!foo; say $!bar }, FETCH => method omg2(*@) { say $!foo; say $!bar }) } }; Test.new().burp() = 10 10:57
in that case i can just commit the bounds check
camelia rakudo-moar f0e6ae: OUTPUT«Memory allocation failed; could not allocate 7931504 bytes␤»
timotimo huh, did i infinitely recurse here? 10:59
ah, yes 11:03
terminal doesn't hold enough lines for me to scroll up :) 11:04
m: class Test { has $!foo = 100; has $!bar = "whoa"; method burp { return Proxy.new(STORE => method omg(*@) { say $!foo; say $!bar }, FETCH => method omg2(*@) { say "oh well"; }) } }; Test.new().burp() = 10 11:09
*shrug*
camelia rakudo-moar f0e6ae: OUTPUT«Memory allocation failed; could not allocate 7932312 bytes␤» 11:10
timotimo jnthn: attr_inited doesn't use the hint parameter that's passed in; is that just an oversight? i'd make the code to get the slot the same as in getattr and bindattr otherwise 11:13
dalek arVM: bcce4a7 | timotimo++ | src/6model/reprs/P6opaque.c:
bounds check for hints in get_attribute and bind_attribute

running a method against a class that wasn't expected that then goes and uses private attributes could crash us here (see #398).
Now we "just" return a bogus attribute instead.
11:18
timotimo there's also no check for (!repr_data) in the attr_inited function, even though try_get_slot will immediately go ahead and dereference it 11:21
m: use nqp; class Test { has $!foo; say nqp::attrinited(self, Test, '$!foo') };
camelia rakudo-moar f0e6ae: OUTPUT«===SORRY!=== Error while compiling <tmp>␤'self' used where no object is available␤at <tmp>:1␤------> s Test { has $!foo; say nqp::attrinited(⏏self, Test, '$!foo') };␤ expecting any of:␤ argument list␤ term␤»
timotimo m: use nqp; class Test { has $!foo; say nqp::attrinited(Test, Test, '$!foo') };
camelia rakudo-moar f0e6ae: OUTPUT«Cannot look up attributes in a type object␤ in block <unit> at <tmp> line 1␤␤»
timotimo not sure how to actually get a concrete value of an uncomposed class, though 11:22
dalek arVM: 344f379 | timotimo++ | src/6model/reprs/P6opaque.c:
use hints for is_attribute_initialized, null check repr_data

11:29
11:55 vendethiel joined
timotimo maybe i should revert the use hints thing because all over the codebase we just pass NO_HINT. 12:02
12:05 domidumont joined 12:12 domidumont joined
dalek arVM: 5108035 | timotimo++ | src/6model/reprs/P6opaque.c:
we only ever pass NO_HINT here, so remove "dead" code for now

12:15
15:37 pyrimidine joined 17:03 domidumont joined 17:39 vendethiel joined 17:47 domidumont joined 17:50 Ven joined 17:58 harrow joined 18:24 domidumont joined 19:09 TheLemonMan joined 20:22 zakharyas joined