[Bro-Dev] [JIRA] (BIT-1233) Parameters inside dynamically instantiated functions bind incorrectly

Robin Sommer (JIRA) jira at bro-tracker.atlassian.net
Fri Aug 22 15:32:07 PDT 2014


     [ https://bro-tracker.atlassian.net/browse/BIT-1233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robin Sommer updated BIT-1233:
------------------------------
    Resolution: Merged  (was: Fixed)
        Status: Closed  (was: Merge Request)

> Parameters inside dynamically instantiated functions bind incorrectly
> ---------------------------------------------------------------------
>
>                 Key: BIT-1233
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-1233
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: Bro
>    Affects Versions: git/master
>            Reporter: Robin Sommer
>              Labels: language
>
> The example below should print "2 1", but prints "2 2". I'm not sure if we can actually fix that easily, but if not it should at least print an error message that binding to outer parameters isn't supported.
> {noformat}
> type Foo: record {
>         x: function(a: string) : string;
> };
> function bar(b: string)
>         {
>         local f: Foo;
>         f = [$x=function(a: string) : string
>                 {
>                 return cat(a, " ", b);
>                 }
>              ];
>         print f$x("2");
>         }
> event bro_init()
>         {
>         bar("1");
>         }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4-OD-03-010#64001)


More information about the bro-dev mailing list