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

Jon Siwek (JIRA) jira at bro-tracker.atlassian.net
Fri Aug 22 15:03:08 PDT 2014


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

Jon Siwek updated BIT-1233:
---------------------------
    Status: Merge Request  (was: Open)

> 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