jackxiao / jslibs

Automatically exported from code.google.com/p/jslibs
0 stars 0 forks source link

Missing GC protection on a returned buffer #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in jsHelper.h
JsvalToStringAndLength and JsvalToString functions returns a buffer that is
not protected from the GC.

The idea is to change the jsval into a jsval* and to do something like:
str = JS_ValueToString();
*val = STRING_TO_JSVAL(str);

Original issue reported on code.google.com by sou...@gmail.com on 1 Aug 2008 at 8:57

GoogleCodeExporter commented 9 years ago
risky code is followed by the comment:
(TBD) check if proto is needed !

Original comment by sou...@gmail.com on 1 Aug 2008 at 9:08

GoogleCodeExporter commented 9 years ago
changing prototype of JsvalToStringAndLength and JsvalToString. see r1846

Original comment by sou...@gmail.com on 7 Aug 2008 at 8:33

GoogleCodeExporter commented 9 years ago
pass QA tests with gcZeal = 2

Original comment by sou...@gmail.com on 24 May 2009 at 9:04

GoogleCodeExporter commented 9 years ago

Original comment by sou...@gmail.com on 2 Jun 2011 at 6:06