@@ -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 ));
@@ -359,7 +359,7 @@ static int regexp_tostring(lua_State *lstate) {
359
359
static int match_tostring (lua_State * lstate ) {
360
360
// luaL_getmetatable(lstate, JSREGEXP_MATCH);
361
361
// if (!lua_getmetatable(lstate, 1) || !lua_equal(lstate, -1, -2)) {
362
- // luaL_argerror(lstate, 1, "match object expected");
362
+ // return luaL_argerror(lstate, 1, "match object expected");
363
363
// }
364
364
lua_rawgeti (lstate , 1 , 0 );
365
365
return 1 ;
@@ -408,7 +408,7 @@ static int regexp_exec(lua_State *lstate) {
408
408
input -> len , input -> is_wide_char ? 1 : 0 , NULL );
409
409
410
410
if (ret < 0 ) {
411
- luaL_error (lstate , "out of memory in regexp execution" );
411
+ return luaL_error (lstate , "out of memory in regexp execution" );
412
412
}
413
413
414
414
if (ret == 0 ) {
@@ -598,7 +598,7 @@ static int regexp_newindex(lua_State *lstate) {
598
598
luaL_argcheck (lstate , ind >= 1 , 3 , "last_index must be positive" );
599
599
r -> last_index = ind - 1 ;
600
600
} else {
601
- luaL_argerror (lstate , 2 , "unrecognized key" );
601
+ return luaL_argerror (lstate , 2 , "unrecognized key" );
602
602
}
603
603
604
604
return 0 ;
@@ -622,7 +622,7 @@ static int jsregexp_compile(lua_State *lstate) {
622
622
// lre_compile can segfault if the input contains 0x8f, which
623
623
// indicated the beginning of a six byte sequence, but is now illegal.
624
624
if (strchr (regexp , 0xfd )) {
625
- luaL_argerror (lstate , 1 , "malformed unicode" );
625
+ return luaL_argerror (lstate , 1 , "malformed unicode" );
626
626
}
627
627
628
628
if (utf8_contains_non_bmp (regexp )) {
@@ -667,7 +667,7 @@ static int jsregexp_compile(lua_State *lstate) {
667
667
strlen (regexp ), re_flags , NULL );
668
668
669
669
if (!bc ) {
670
- luaL_argerror (lstate , 1 , error_msg );
670
+ return luaL_argerror (lstate , 1 , error_msg );
671
671
}
672
672
673
673
struct regexp * ud = lua_newuserdata (lstate , sizeof * ud );
0 commit comments