mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 05:27:23 +00:00
fix stack overflow in jsToCString.
This commit is contained in:
@@ -6,6 +6,10 @@
|
|||||||
* @LastEditTime: 2020-12-02 11:36:40
|
* @LastEditTime: 2020-12-02 11:36:40
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## 0.2.6
|
||||||
|
|
||||||
|
* fix stack overflow in jsToCString.
|
||||||
|
|
||||||
## 0.2.5
|
## 0.2.5
|
||||||
|
|
||||||
* remove dart object when jsfree.
|
* remove dart object when jsfree.
|
||||||
|
@@ -251,7 +251,11 @@ extern "C"
|
|||||||
|
|
||||||
DLLEXPORT const char *jsToCString(JSContext *ctx, JSValueConst *val)
|
DLLEXPORT const char *jsToCString(JSContext *ctx, JSValueConst *val)
|
||||||
{
|
{
|
||||||
return JS_ToCString(ctx, *val);
|
JSRuntime *rt = JS_GetRuntime(ctx);
|
||||||
|
uint8_t *stack_top = JS_SetStackTop(rt, 0);
|
||||||
|
const char *ret = JS_ToCString(ctx, *val);
|
||||||
|
JS_SetStackTop(rt, stack_top);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLLEXPORT void jsFreeCString(JSContext *ctx, const char *ptr)
|
DLLEXPORT void jsFreeCString(JSContext *ctx, const char *ptr)
|
||||||
|
@@ -82,7 +82,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.2.5"
|
version: "0.2.6"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
name: flutter_qjs
|
name: flutter_qjs
|
||||||
description: This plugin is a simple js engine for flutter using the `quickjs` project. Plugin currently supports all the platforms except web!
|
description: This plugin is a simple js engine for flutter using the `quickjs` project. Plugin currently supports all the platforms except web!
|
||||||
version: 0.2.5
|
version: 0.2.6
|
||||||
homepage: https://github.com/ekibun/flutter_qjs
|
homepage: https://github.com/ekibun/flutter_qjs
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
Reference in New Issue
Block a user