Re: [perl #56274] [PATCH] Re: design problem with :outer

2008-06-24 Thread Mehmet Yavuz Selim Soyturk
There is another problem with :outer. It does not let you create inner functions dynamically. For example, I couldn't use it to compile next ECMAScript code: function outer() { var i = 0; return eval(function() { return i++; }); } Is it not possible to have an opcode that

Re: eval() and lexical introspection in Parrot

2007-12-19 Thread Mehmet Yavuz Selim Soyturk
One temporary workaround that I considered for this problem would be to have eval() use introspection on its caller to create a wrapper sub that duplicates the lexical environment of the caller, and then use that as the target of an :outer() flag when it's passed to imcc. For example, the

[perl #48134] [BUG][PATCH]interp-current_args overwritten in callmethodcc

2007-12-04 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by Mehmet Yavuz Selim Soyturk # Please include the string: [perl #48134] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48134 Next code segfaults because callmethodcc does another method call

[perl #47704] [BUG]Memory leak with STRING's

2007-11-22 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by Mehmet Yavuz Selim Soyturk # Please include the string: [perl #47704] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=47704 There is a memory leak with the STRING's. Next C code consumes more

Re: [perl #47572] [BUG] Memory leak with PMCProxy

2007-11-20 Thread Mehmet Yavuz Selim Soyturk
I think that the leak is at CParrot_PCCINVOKE. I tested it that way: test.pmc #include parrot/parrot.h pmclass Test dynpmc group pjs_group hll Pjs { void set_integer_native(INTVAL ignore) { int i; for(i=0;i1000;i++) {

Re: Perl 6 Junctions and MMD

2007-11-19 Thread Mehmet Yavuz Selim Soyturk
We could maybe assume that the ordering is well defined between the instances of a PMC class. But cmp needs to compare instances of different PMC classes as well, for which a well defined ordering is less probable. I would not be surprised if in some dynamic language all of a==b, ab and ab

[perl #47572] [BUG] Memory leak with PMCProxy

2007-11-18 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by Mehmet Yavuz Selim Soyturk # Please include the string: [perl #47572] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=47572 If you have defined an .HLL in your program, any pmc leaks. I could

Re: [perl #47572] [BUG] Memory leak with PMCProxy

2007-11-18 Thread Mehmet Yavuz Selim Soyturk
[Sorry chromatic, forgot to send to the list] Did you happen to catch which PMC it is that's leaking? I don't know which PMC, but the leak happens when you create a PMCProxy with init_pmc. Also, is this with PIR or PBC or both? Both. Do you have a short test case that Valgrind catches? I

Re: Perl 6 Junctions and MMD

2007-11-18 Thread Mehmet Yavuz Selim Soyturk
I agree. See http://www.nntp.perl.org/group/perl.perl6.internals/2007/08/msg39889.html

Re: [perl #45695] [PATCH] Remove seemingly unnecessary Parrot_cont-from_ctx

2007-09-24 Thread Mehmet Yavuz Selim Soyturk
-if (cc-from_ctx) -Parrot_free_context(interp, cc-from_ctx, 0); -Parrot_free_context(INTERP, from_ctx, 1); I don't know much about this context stuff, so maybe I don't see something, but how are those contexts freed after your patch?

Comparison of PMCs + incosistent comparison of NaNs

2007-08-29 Thread Mehmet Yavuz Selim Soyturk
Hello, PJS (Parrot JavaScript) allows a number to be NaN. The result of comparing an NaN to any value is false (thus all of NaN == NaN, NaN NaN, NaN NaN, NaN = NaN, NaN = NaN evaluate to false). There is only the vtable function Ccmp that a PMC can implement to define ordering. Parrot assumes

Re: [perl #44995] Dereferencing NULL pointers (Coverity)

2007-08-27 Thread Mehmet Yavuz Selim Soyturk
I don't think that the code is safe, but it does what it means :) =item Bhcf Halt and Catch Fire. Tries to crash parrot. =cut op hcf() { int *a, i; a = NULL; i = *a; goto OFFSET(i) ; /* in case your runtime is very forgiving. */ } -- Mehmet

Re: [perl #44499] Move cstrings to String Structure

2007-08-08 Thread Mehmet Yavuz Selim Soyturk
On 8/8/07, via RT chromatic [EMAIL PROTECTED] wrote: # New Ticket Created by chromatic # Please include the string: [perl #44499] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44499 The string_from_cstring()

Re: [perl #44499] Move cstrings to String Structure

2007-08-08 Thread Mehmet Yavuz Selim Soyturk
What about a real_exception variant that accepts STRING*'s as arguments? On the other hand, as you said, there will be other functions which don't return control (functions that call real_exception etc.). But then char* is not the only problem, any malloced data can leak. void f() {

[perl #44247] Using :flat calling a PMC METHOD causes a segfault.

2007-07-29 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by Mehmet Yavuz Selim Soyturk # Please include the string: [perl #44247] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44247 Calling a METHOD (declared in a pmclass) from PIR with :flat modifier

Re: [perl #44247] Using :flat calling a PMC METHOD causes a segfault.

2007-07-29 Thread Mehmet Yavuz Selim Soyturk
Does the attached patch solve the problem? Yes, it does. Thanks.

Re: [perl #43105] [PATCH] function mmd.c::mmd_expand_y: newly allocated memory unitialized

2007-06-02 Thread Mehmet Yavuz Selim Soyturk
On 6/2/07, chromatic [EMAIL PROTECTED] wrote: On Friday 01 June 2007 16:29:08 Mehmet Yavuz Selim Soyturk wrote: After a suggestion of Bernhard at #parrot, I added a function named Cmem_sys_realloc_zeroed to parrot: void * mem__sys_realloc_zeroed(void *from, size_t size, size_t old_size

mmd for bitwise_and causes a segfault with my pmc types

2007-06-01 Thread Mehmet Yavuz Selim Soyturk
Hello, I have two pmc classes PjsNumber and PjsBoolean, which define bitwise_and like this: PMC* bitwise_and(PMC* value, PMC* dest) { FLOATVAL a, b; if (! dest) { dest = pmc_new(INTERP, dynpmc_PjsNumber); } else if (dest-vtable-base_type != dynpmc_PjsNumber) {

Re: mmd for bitwise_and causes a segfault with my pmc types

2007-06-01 Thread Mehmet Yavuz Selim Soyturk
It seems to work in general, but in some cases (especially when I allocate too much memory) it causes me a segfault or an error like: Trace/breakpoint trap (core dumped) It was caused by some unitialized memory in src/mmd.c. rt #43105 solves it. -- Mehmet

[perl #43105] [PATCH] function mmd.c::mmd_expand_y: newly allocated memory unitialized

2007-06-01 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by Mehmet Yavuz Selim Soyturk # Please include the string: [perl #43105] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43105 Function mmd_expand_y in src/mmd.c allocates new memory for the mmd

[perl #43002] [PATCH] Minor enhancements for kate syntax highlighting

2007-05-21 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by Mehmet Yavuz Selim Soyturk # Please include the string: [perl #43002] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43002 file: editor/kate_syntax.pl * .ops files are now searched

Re: [perl #42974] [BUG] Hungry Alligator Eats Integer; Developer Registers Complaint

2007-05-17 Thread Mehmet Yavuz Selim Soyturk
On 5/17/07, Klaas-Jan Stol [EMAIL PROTECTED] wrote: On 5/17/07, Mehmet Yavuz Selim Soyturk [EMAIL PROTECTED] wrote: On 5/17/07, via RT Jerry Gay [EMAIL PROTECTED] wrote: # New Ticket Created by Jerry Gay # Please include the string: [perl #42974] # in the subject line of all future

Re: [perl #42919] [BUG] and [PATCH] overriding 'invoke' requires current object to be explicitly passed

2007-05-16 Thread Mehmet Yavuz Selim Soyturk
The results of my first post in this thread were probably caused by the fact that some files were not updated correctly (I am new to revision control). Both Allison's and Alek's patches have in fact the same effect. But the problem that I stated in my second post and the proposed solution are

Re: [perl #42974] [BUG] Hungry Alligator Eats Integer; Developer Registers Complaint

2007-05-16 Thread Mehmet Yavuz Selim Soyturk
On 5/17/07, via RT Jerry Gay [EMAIL PROTECTED] wrote: # New Ticket Created by Jerry Gay # Please include the string: [perl #42974] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42974 it looks like the register

Re: [perl #42919] [BUG] and [PATCH] overriding 'invoke' requires current object to be explicitly passed

2007-05-14 Thread Mehmet Yavuz Selim Soyturk
On 5/10/07, via RT Alek Storm [EMAIL PROTECTED] wrote: # New Ticket Created by Alek Storm # Please include the string: [perl #42919] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42919 Because PIR can't tell the

[perl #42790] [BUG] Tailcall with slurpy argument passing causes a memory leak

2007-04-29 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by Mehmet Yavuz Selim Soyturk # Please include the string: [perl #42790] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42790 Next program makes a slurpy tailcall, and it causes a memory leak

[perl #42320] [BUG] Memory leak with String pmc

2007-04-06 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by Mehmet Yavuz Selim Soyturk # Please include the string: [perl #42320] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42320 The next program causes a memory leak for me. .sub main :main loop

C pmclass - parrot object inheritance, interaction vtables/methods/object identities

2007-03-08 Thread Mehmet Yavuz Selim Soyturk
Hello, I'm implementing ECMAscript (javascript) which has prototype based inheritance. An object is some sort of hash which has some properties. An object can have a prototype, from which it inherits all of the properties. And the objects prototype can also have a prototype, from which the

Re: [perl #41642] [BUG] tailcall with slurpy gives segfault

2007-03-01 Thread Mehmet Yavuz Selim Soyturk
Does the following patch fix it? Sorry, I can't test if that patch helps. I was getting consistently a segfault for that sort of tailcalls, but now it's gone. As far as I can remember, I didn't change anything to parrot (no updates, the same default configuration). I only did a reboot. I don't

Re: [perl #41642] [BUG] tailcall with slurpy gives segfault

2007-03-01 Thread Mehmet Yavuz Selim Soyturk
On 3/1/07, Mehmet Yavuz Selim Soyturk [EMAIL PROTECTED] wrote: Does the following patch fix it? Sorry, I can't test if that patch helps. I was getting consistently a segfault for that sort of tailcalls, but now it's gone. As far as I can remember, I didn't change anything to parrot (no updates

[perl #41642] [BUG] tailcall with slurpy gives segfault

2007-02-28 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by Mehmet Yavuz Selim Soyturk # Please include the string: [perl #41642] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41642 ### ## file tail.pir: .namespace

Re: Null PMC access while parsing javascript

2006-10-11 Thread Mehmet Yavuz Selim Soyturk
I have rewritten the grammar. There are some problems though. - I don't know how to express thinks like: an identifier is [a..zA..Z_$]*, but not a keyword. Something like: rule identifier {!keyword[a..zA..Z_$]*} seems not to allow identifiers that have keywords as prefix. - I couldn't make

Re: Null PMC access while parsing javascript

2006-10-10 Thread Mehmet Yavuz Selim Soyturk
Hi Mehmet, you might have run into a Garbage-Collector bug. Try parrot --no-gc main.pir 'x' 'identifier' I had similar problems using PGE::P6Regex. '--no-gc' helped. Regards, Kiwi The same problem. I think that I now know the problem: the grammar is not complete. I was thinking that

Null PMC access while parsing javascript

2006-10-09 Thread Mehmet Yavuz Selim Soyturk
js.pg in languages/ecmascript/src compiles just fine with pgc. But it gives a Null PMC access error while using the compiled pir file. Is it a pge bug? $ cd languages/ecmascript/src $ cat main.pir .include 'errors.pasm' .sub _main :main .param pmc args .local string source_code,

Re: Java Script in Parrot

2006-07-09 Thread Mehmet Yavuz Selim Soyturk
I am too planning to implement ECMAScript. I do not yet know how, I have to experiment with parrot first.