update slice test code.

This commit is contained in:
anod221 2018-08-31 11:16:37 +08:00 committed by GitHub
parent 3b62d988d8
commit 65a4b5e828
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -829,7 +829,7 @@ static int lbytearr_slice( lua_State *L )
handle_scope_except();
Buf *r;
if( start > end || getLength(p) <= start ){ // empty array
if( end < 0 || start > end || (int)getLength(p) <= start ){ // empty array
r = createBuf( BYTEARRAY_RESERVE_SIZE, getNativeEndian() );
}
else{