diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-05-24 17:25:14 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-05-24 17:25:14 -0300 |
commit | 3b8dba5279e98e03a194f048a82fcab9945bbbed (patch) | |
tree | f24a29f3a5268f11eb3a8f64518a2537268da1da | |
parent | 892aff2a07585eee25bf9fd68e9c2538d537b74f (diff) | |
download | lua-3b8dba5279e98e03a194f048a82fcab9945bbbed.tar.gz lua-3b8dba5279e98e03a194f048a82fcab9945bbbed.tar.bz2 lua-3b8dba5279e98e03a194f048a82fcab9945bbbed.zip |
added patches for two bugs (5.3.4-2 and 5.3.4-3)
-rw-r--r-- | bugs | 53 |
1 files changed, 51 insertions, 2 deletions
@@ -3680,9 +3680,9 @@ It needs an "interceptor" 'memcmp' function that continues | |||
3680 | reading memory after a difference is found.]], | 3680 | reading memory after a difference is found.]], |
3681 | patch = [[ | 3681 | patch = [[ |
3682 | 2c2 | 3682 | 2c2 |
3683 | < ** $Id: bugs,v 1.158 2017/12/06 18:20:28 roberto Exp roberto $ | 3683 | < ** $Id: bugs,v 1.159 2017/12/13 18:35:03 roberto Exp roberto $ |
3684 | --- | 3684 | --- |
3685 | > ** $Id: bugs,v 1.158 2017/12/06 18:20:28 roberto Exp roberto $ | 3685 | > ** $Id: bugs,v 1.159 2017/12/13 18:35:03 roberto Exp roberto $ |
3686 | 263c263,264 | 3686 | 263c263,264 |
3687 | < for (option = LUA_STRFTIMEOPTIONS; *option != '\0'; option += oplen) { | 3687 | < for (option = LUA_STRFTIMEOPTIONS; *option != '\0'; option += oplen) { |
3688 | --- | 3688 | --- |
@@ -3737,6 +3737,10 @@ patch = [[ | |||
3737 | } | 3737 | } |
3738 | 3738 | ||
3739 | 3739 | ||
3740 | ----------------------------------------------------------------- | ||
3741 | -- Lua 5.3.4 | ||
3742 | |||
3743 | |||
3740 | Bug{ | 3744 | Bug{ |
3741 | what = [[Wrong code for a goto followed by a label inside an 'if']], | 3745 | what = [[Wrong code for a goto followed by a label inside an 'if']], |
3742 | report = [[云风, 2017/04/13]], | 3746 | report = [[云风, 2017/04/13]], |
@@ -3782,6 +3786,19 @@ for i = 1, 0x7fffffff do | |||
3782 | end | 3786 | end |
3783 | ]], | 3787 | ]], |
3784 | patch = [[ | 3788 | patch = [[ |
3789 | --- ltable.c 2017/04/19 17:20:42 2.118.1.1 | ||
3790 | +++ ltable.c 2018/05/24 18:34:38 | ||
3791 | @@ -223,7 +223,9 @@ | ||
3792 | unsigned int na = 0; /* number of elements to go to array part */ | ||
3793 | unsigned int optimal = 0; /* optimal size for array part */ | ||
3794 | /* loop while keys can fill more than half of total size */ | ||
3795 | - for (i = 0, twotoi = 1; *pna > twotoi / 2; i++, twotoi *= 2) { | ||
3796 | + for (i = 0, twotoi = 1; | ||
3797 | + twotoi > 0 && *pna > twotoi / 2; | ||
3798 | + i++, twotoi *= 2) { | ||
3799 | if (nums[i] > 0) { | ||
3800 | a += nums[i]; | ||
3801 | if (a > twotoi/2) { /* more than half elements present? */ | ||
3785 | ]] | 3802 | ]] |
3786 | } | 3803 | } |
3787 | 3804 | ||
@@ -3801,9 +3818,41 @@ end | |||
3801 | print(#t) | 3818 | print(#t) |
3802 | ]], | 3819 | ]], |
3803 | patch = [[ | 3820 | patch = [[ |
3821 | --- ltable.h 2017/04/19 17:20:42 2.23.1.1 | ||
3822 | +++ ltable.h 2018/05/24 19:31:50 | ||
3823 | @@ -56,3 +56,3 @@ | ||
3824 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); | ||
3825 | -LUAI_FUNC int luaH_getn (Table *t); | ||
3826 | +LUAI_FUNC lua_Unsigned luaH_getn (Table *t); | ||
3827 | |||
3828 | --- ltable.c 2018/05/24 19:22:37 2.118.1.2 | ||
3829 | +++ ltable.c 2018/05/24 19:25:05 | ||
3830 | @@ -614,4 +614,4 @@ | ||
3831 | |||
3832 | -static int unbound_search (Table *t, unsigned int j) { | ||
3833 | - unsigned int i = j; /* i is zero or a present index */ | ||
3834 | +static lua_Unsigned unbound_search (Table *t, lua_Unsigned j) { | ||
3835 | + lua_Unsigned i = j; /* i is zero or a present index */ | ||
3836 | j++; | ||
3837 | @@ -620,3 +620,3 @@ | ||
3838 | i = j; | ||
3839 | - if (j > cast(unsigned int, MAX_INT)/2) { /* overflow? */ | ||
3840 | + if (j > l_castS2U(LUA_MAXINTEGER) / 2) { /* overflow? */ | ||
3841 | /* table was built with bad purposes: resort to linear search */ | ||
3842 | @@ -630,3 +630,3 @@ | ||
3843 | while (j - i > 1) { | ||
3844 | - unsigned int m = (i+j)/2; | ||
3845 | + lua_Unsigned m = (i+j)/2; | ||
3846 | if (ttisnil(luaH_getint(t, m))) j = m; | ||
3847 | @@ -642,3 +642,3 @@ | ||
3848 | */ | ||
3849 | -int luaH_getn (Table *t) { | ||
3850 | +lua_Unsigned luaH_getn (Table *t) { | ||
3851 | unsigned int j = t->sizearray; | ||
3804 | ]] | 3852 | ]] |
3805 | } | 3853 | } |
3806 | 3854 | ||
3855 | |||
3807 | Bug{ | 3856 | Bug{ |
3808 | what = [[Lua does not check GC when creating error messages]], | 3857 | what = [[Lua does not check GC when creating error messages]], |
3809 | report = [[Viacheslav Usov, 2017/07/06]], | 3858 | report = [[Viacheslav Usov, 2017/07/06]], |