From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (unknown [IPv6:2602:4b:a4ef:2500:12bf:48ff:fe7c:5584]) by hurricane.the-brannons.com (Postfix) with ESMTPSA id 22DC077889 for ; Sat, 18 Jan 2014 10:23:07 -0800 (PST) From: Chris Brannon To: edbrowse-dev@lists.the-brannons.com Date: Sat, 18 Jan 2014 10:23:00 -0800 Message-ID: <871u05up2z.fsf@mushroom.PK5001Z> MIME-Version: 1.0 Content-Type: text/plain Subject: [Edbrowse-dev] javaParseExecute incorrect use of variable X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2014 18:23:07 -0000 This is mainly for Adam, so he can fix it in his jsdom.cpp. I'll fix it in jsdom.c on the master branch shortly. Here's a fragment of the documentation for JS_EvaluateScript: If a script compiles and executes successfully, JS_EvaluateScript or JS_EvaluateUCScript stores the result in *rval, if non-null, and returns JS_TRUE. Otherwise it returns JS_FALSE and the value left in *rval is undefined. Here's what we do, from line 1089 of jsdom.c on master: ok = JS_EvaluateScript(jcx, this, str, strlen(str), filename, lineno, &rval); rc = eb_true; if(JSVAL_IS_BOOLEAN(rval)) rc = JSVAL_TO_BOOLEAN(rval); We never check "ok". If "ok" is false, the contents of rval shouldn't be used, since they are undefined. -- Chris