HeapsIO / hxbit

Haxe Binary serialization and network synchronization library
155 stars 30 forks source link

networkAllow not tested on failing @condSend() variable writes #31

Open trethaller opened 6 years ago

trethaller commented 6 years ago

Currently clients are allowed to modify vars marked as condSend(false) without any error:

        if( t.condSend.expr.match(EConst(CIdent("false"))) )
            return macro {}; // no marking
        var condSend = loop(t.condSend);
        needRef = true;
        mark = macro if( $condSend ) { this.$rname = this.$fname; $mark; };

We discussed removing the "no marking" optimization and adding a checkWrite() call in the else case so all failing condSend() are properly tested on clients.