Bug: Cache "callSites" logic is wrong.

Oct 17, 2014 at 2:51 AM
Hi,

In LuaTable.cs:
        private LuaResult RtInvokeSiteCached(object[] args)
        {
            // get cached call site
            CallSite site;
            if (!callSites.TryGetValue(args.Length, out site))
                args[0] = site;
            // call site
            return new LuaResult(Lua.RtInvokeSite(GetInvokeBinder, (callInfo, callSite) => callSites[callInfo.ArgumentCount + 1] = callSite, args));
        } // func RtInvokeSiteCached
The "!" is wrong.
It should be:
        private LuaResult RtInvokeSiteCached(object[] args)
        {
            // get cached call site
            CallSite site;
            if (callSites.TryGetValue(args.Length, out site))
                args[0] = site;
            // call site
            return new LuaResult(Lua.RtInvokeSite(GetInvokeBinder, (callInfo, callSite) => callSites[callInfo.ArgumentCount + 1] = callSite, args));
        } // func RtInvokeSiteCached
Coordinator
Oct 17, 2014 at 12:06 PM
arrg

Thank you, for this good reports.

ChangeSet 32266