@@ -135,7 +135,7 @@ static int jsstring_new(lua_State *lstate) {
135
135
& indices , & rev_indices );
136
136
137
137
if (!input_utf16 ) {
138
- luaL_error (lstate , "malformed unicode" );
138
+ return luaL_error (lstate , "malformed unicode" );
139
139
}
140
140
141
141
ud = lua_newuserdata (lstate , sizeof (* ud ));
@@ -221,7 +221,7 @@ static int regexp_tostring(lua_State *lstate) {
221
221
static int match_tostring (lua_State * lstate ) {
222
222
// luaL_getmetatable(lstate, JSREGEXP_MATCH);
223
223
// if (!lua_getmetatable(lstate, 1) || !lua_equal(lstate, -1, -2)) {
224
- // luaL_argerror(lstate, 1, "match object expected");
224
+ // return luaL_argerror(lstate, 1, "match object expected");
225
225
// }
226
226
lua_rawgeti (lstate , 1 , 0 );
227
227
return 1 ;
@@ -270,7 +270,7 @@ static int regexp_exec(lua_State *lstate) {
270
270
input -> len , input -> is_wide_char ? 1 : 0 , NULL );
271
271
272
272
if (ret < 0 ) {
273
- luaL_error (lstate , "out of memory in regexp execution" );
273
+ return luaL_error (lstate , "out of memory in regexp execution" );
274
274
}
275
275
276
276
if (ret == 0 ) {
@@ -460,7 +460,7 @@ static int regexp_newindex(lua_State *lstate) {
460
460
luaL_argcheck (lstate , ind >= 1 , 3 , "last_index must be positive" );
461
461
r -> last_index = ind - 1 ;
462
462
} else {
463
- luaL_argerror (lstate , 2 , "unrecognized key" );
463
+ return luaL_argerror (lstate , 2 , "unrecognized key" );
464
464
}
465
465
466
466
return 0 ;
@@ -483,7 +483,7 @@ static int jsregexp_compile(lua_State *lstate) {
483
483
// lre_compile can segfault if the input contains 0x8f, which
484
484
// indicated the beginning of a six byte sequence, but is now illegal.
485
485
if (strchr (regexp , 0xfd )) {
486
- luaL_argerror (lstate , 1 , "malformed unicode" );
486
+ return luaL_argerror (lstate , 1 , "malformed unicode" );
487
487
}
488
488
489
489
if (utf8_contains_non_bmp (regexp )) {
@@ -528,7 +528,7 @@ static int jsregexp_compile(lua_State *lstate) {
528
528
strlen (regexp ), re_flags , NULL );
529
529
530
530
if (!bc ) {
531
- luaL_argerror (lstate , 1 , error_msg );
531
+ return luaL_argerror (lstate , 1 , error_msg );
532
532
}
533
533
534
534
struct regexp * ud = lua_newuserdata (lstate , sizeof * ud );
0 commit comments