Stack underflow with meta links on message nodes
Hi, Iâm trying to use methinks on message nodes that are executed before the node itself and have receiver and the node as arguments. But sadly Iâm getting âstack underflowâ error when the annotated method is executed. You can use this code snippet to reproduce the error: | link class | link := MetaLink new metaObject: [ :v1 :v2 | ]; control: #before; selector: #value:value:; arguments: #(receiver node). class := Object newAnonymousSubclass. class compile: 'method 1+1'. (class >> #method) ast statements first link: link. class new method. link uninstall Is there any workaround for this issue? Or maybe someone knows how to fix this. Because the issue is present both in Pharo 5 and the latest Pharo 6. Cheers. Uko
Hi, This looks like a bug, I will check (but tomorrow). Marcus
On 29 Nov 2016, at 16:52, Yuriy Tymchuk <yuriy.tymchuk@me.com> wrote:
Hi, Iâm trying to use methinks on message nodes that are executed before the node itself and have receiver and the node as arguments. But sadly Iâm getting âstack underflowâ error when the annotated method is executed. You can use this code snippet to reproduce the error:
| link class |
link := MetaLink new metaObject: [ :v1 :v2 | ]; control: #before; selector: #value:value:; arguments: #(receiver node).
class := Object newAnonymousSubclass. class compile: 'method 1+1'. (class >> #method) ast statements first link: link.
class new method.
link uninstall
Is there any workaround for this issue? Or maybe someone knows how to fix this. Because the issue is present both in Pharo 5 and the latest Pharo 6.
Cheers. Uko
2016-11-29 16:52 GMT+01:00 Yuriy Tymchuk <yuriy.tymchuk@me.com>:
Is there any workaround for this issue? Or maybe someone knows how to fix this. Because the issue is present both in Pharo 5 and the latest Pharo 6.
Probably meta level is not defined somewhere on MetaLink's part. When MetaLink start execution it checks current meta level and if it is higher than where it was installed then link should be ignored. For example recursion could happen if #value:value is used to resolve some #control object and meta level not defined for this part.
participants (3)
-
Denis Kudriashov -
Marcus Denker -
Yuriy Tymchuk