Lua diffs-lua-5.3.2-lua-5.3.3


Makefile

49c49
< R= $V.2
> R= $V.3

README

2c2
< This is Lua 5.3.2, released on 25 Nov 2015.
> This is Lua 5.3.3, released on 30 May 2016.

doc/contents.html

35c35
< Copyright &copy; 2015 Lua.org, PUC-Rio.
> Copyright &copy; 2015&ndash;2016 Lua.org, PUC-Rio.

611c611
< Wed Jun  3 08:27:30 BRT 2015
> Thu Jan 14 10:14:28 BRST 2016

614c614
< Last change: revised for Lua 5.3.1
> Last change: revised for Lua 5.3.3

doc/lua.css

94a95
> 	text-transform: lowercase ;

159a161,164
> 
> img {
> 	background-color: white ;
> }

doc/manual.html

22c22
< Copyright &copy; 2015 Lua.org, PUC-Rio.
> Copyright &copy; 2015&ndash;2016 Lua.org, PUC-Rio.

38c38
< <!-- $Id: manual.of,v 1.153 2015/11/25 16:57:42 roberto Exp $ -->
> <!-- $Id: manual.of,v 1.162 2016/05/30 15:57:03 roberto Exp $ -->

46,52c46,64
< Lua is an extension programming language designed to support
< general procedural programming with data description
< facilities.
< Lua also offers good support for object-oriented programming,
< functional programming, and data-driven programming.
< Lua is intended to be used as a powerful, lightweight,
< embeddable scripting language for any program that needs one.
> Lua is a powerful, efficient, lightweight, embeddable scripting language.
> It supports procedural programming,
> object-oriented programming, functional programming,
> data-driven programming, and data description.
> 
> 
> <p>
> Lua combines simple procedural syntax with powerful data description
> constructs based on associative arrays and extensible semantics.
> Lua is dynamically typed,
> runs by interpreting bytecode with a register-based
> virtual machine,
> and has automatic memory management with
> incremental garbage collection,
> making it ideal for configuration, scripting,
> and rapid prototyping.
> 
> 
> <p>

54a67,73
> The Lua distribution includes a host program called <code>lua</code>,
> which uses the Lua library to offer a complete,
> standalone Lua interpreter,
> for interactive or batch use.
> Lua is intended to be used both as a powerful, lightweight,
> embeddable scripting language for any program that needs one,
> and as a powerful but lightweight and efficient stand-alone language.

59c78
< it only works <em>embedded</em> in a host client,
> it works <em>embedded</em> in a host client,

60a80
> (Frequently, this host is the stand-alone <code>lua</code> program.)

67,69d86
< The Lua distribution includes a sample host program called <code>lua</code>,
< which uses the Lua library to offer a complete, standalone Lua interpreter,
< for interactive or batch use.

354,355c371,372
< This function is called with the original error message
< and returns a new error message.
> This function is called with the original error object
> and returns a new error object.

385c402,403
< The keys in a metatable are derived from the <em>event</em> names;
> The key for each event in a metatable is a string
> with the event name prefixed by two underscores;

387c405
< In the previous example, the event is <code>"add"</code>
> In the previous example, the key is "<code>__add</code>"

393a412,414
> Lua queries metamethods in metatables using a raw access (see <a href="#pdf-rawget"><code>rawget</code></a>).
> So, to retrieve the metamethod for event <code>ev</code> in object <code>o</code>,
> Lua does the equivalent to the following code:

394a416,418
> <pre>
>      rawget(getmetatable(<em>o</em>) or {}, "__<em>ev</em>")
> </pre>

423,434c447
< A detailed list of events controlled by metatables is given next.
< Each operation is identified by its corresponding event name.
< The key for each event is a string with its name prefixed by
< two underscores, '<code>__</code>';
< for instance, the key for operation "add" is the
< string "<code>__add</code>".
< Note that queries for metamethods are always raw;
< the access to a metamethod does not invoke other metamethods.
< 
< 
< <p>
< For the unary operators (negation, length, and bitwise not),
> For the unary operators (negation, length, and bitwise NOT),

442a456,460
> <p>
> A detailed list of events controlled by metatables is given next.
> Each operation is identified by its corresponding key.
> 
> 

446,448c464,465
< <li><b>"add": </b>
< the <code>+</code> operation.
< 
> <li><b><code>__add</code>: </b>
> the addition (<code>+</code>) operation.

453c470
< If that operand does not define a metamethod for the "<code>__add</code>" event,
> If that operand does not define a metamethod for <code>__add</code>,

464,467c481,483
< <li><b>"sub": </b>
< the <code>-</code> operation.
< 
< Behavior similar to the "add" operation.
> <li><b><code>__sub</code>: </b>
> the subtraction (<code>-</code>) operation.
> Behavior similar to the addition operation.

470,473c486,488
< <li><b>"mul": </b>
< the <code>*</code> operation.
< 
< Behavior similar to the "add" operation.
> <li><b><code>__mul</code>: </b>
> the multiplication (<code>*</code>) operation.
> Behavior similar to the addition operation.

476,479c491,493
< <li><b>"div": </b>
< the <code>/</code> operation.
< 
< Behavior similar to the "add" operation.
> <li><b><code>__div</code>: </b>
> the division (<code>/</code>) operation.
> Behavior similar to the addition operation.

482,485c496,498
< <li><b>"mod": </b>
< the <code>%</code> operation.
< 
< Behavior similar to the "add" operation.
> <li><b><code>__mod</code>: </b>
> the modulo (<code>%</code>) operation.
> Behavior similar to the addition operation.

488,491c501,503
< <li><b>"pow": </b>
< the <code>^</code> (exponentiation) operation.
< 
< Behavior similar to the "add" operation.
> <li><b><code>__pow</code>: </b>
> the exponentiation (<code>^</code>) operation.
> Behavior similar to the addition operation.

494,497c506,508
< <li><b>"unm": </b>
< the <code>-</code> (unary minus) operation.
< 
< Behavior similar to the "add" operation.
> <li><b><code>__unm</code>: </b>
> the negation (unary <code>-</code>) operation.
> Behavior similar to the addition operation.

500,503c511,513
< <li><b>"idiv": </b>
< the <code>//</code> (floor division) operation.
< 
< Behavior similar to the "add" operation.
> <li><b><code>__idiv</code>: </b>
> the floor division (<code>//</code>) operation.
> Behavior similar to the addition operation.

506,509c516,518
< <li><b>"band": </b>
< the <code>&amp;</code> (bitwise and) operation.
< 
< Behavior similar to the "add" operation,
> <li><b><code>__band</code>: </b>
> the bitwise AND (<code>&amp;</code>) operation.
> Behavior similar to the addition operation,

515,518c524,526
< <li><b>"bor": </b>
< the <code>|</code> (bitwise or) operation.
< 
< Behavior similar to the "band" operation.
> <li><b><code>__bor</code>: </b>
> the bitwise OR (<code>|</code>) operation.
> Behavior similar to the bitwise AND operation.

521,524c529,531
< <li><b>"bxor": </b>
< the <code>~</code> (bitwise exclusive or) operation.
< 
< Behavior similar to the "band" operation.
> <li><b><code>__bxor</code>: </b>
> the bitwise exclusive OR (binary <code>~</code>) operation.
> Behavior similar to the bitwise AND operation.

527,530c534,536
< <li><b>"bnot": </b>
< the <code>~</code> (bitwise unary not) operation.
< 
< Behavior similar to the "band" operation.
> <li><b><code>__bnot</code>: </b>
> the bitwise NOT (unary <code>~</code>) operation.
> Behavior similar to the bitwise AND operation.

533,536c539,541
< <li><b>"shl": </b>
< the <code>&lt;&lt;</code> (bitwise left shift) operation.
< 
< Behavior similar to the "band" operation.
> <li><b><code>__shl</code>: </b>
> the bitwise left shift (<code>&lt;&lt;</code>) operation.
> Behavior similar to the bitwise AND operation.

539,542c544,546
< <li><b>"shr": </b>
< the <code>&gt;&gt;</code> (bitwise right shift) operation.
< 
< Behavior similar to the "band" operation.
> <li><b><code>__shr</code>: </b>
> the bitwise right shift (<code>&gt;&gt;</code>) operation.
> Behavior similar to the bitwise AND operation.

545,548c549,551
< <li><b>"concat": </b>
< the <code>..</code> (concatenation) operation.
< 
< Behavior similar to the "add" operation,
> <li><b><code>__concat</code>: </b>
> the concatenation (<code>..</code>) operation.
> Behavior similar to the addition operation,

554,556c557,558
< <li><b>"len": </b>
< the <code>#</code> (length) operation.
< 
> <li><b><code>__len</code>: </b>
> the length (<code>#</code>) operation.

569,572c571,573
< <li><b>"eq": </b>
< the <code>==</code> (equal) operation.
< 
< Behavior similar to the "add" operation,
> <li><b><code>__eq</code>: </b>
> the equal (<code>==</code>) operation.
> Behavior similar to the addition operation,

579,582c580,582
< <li><b>"lt": </b>
< the <code>&lt;</code> (less than) operation.
< 
< Behavior similar to the "add" operation,
> <li><b><code>__lt</code>: </b>
> the less than (<code>&lt;</code>) operation.
> Behavior similar to the addition operation,

588,590c588,589
< <li><b>"le": </b>
< the <code>&lt;=</code> (less equal) operation.
< 
> <li><b><code>__le</code>: </b>
> the less equal (<code>&lt;=</code>) operation.

593,594c592,593
< First, Lua looks for the "<code>__le</code>" metamethod in both operands,
< like in the "lt" operation.
> First, Lua looks for the <code>__le</code> metamethod in both operands,
> like in the less than operation.

596c595
< then it will try the "<code>__lt</code>" event,
> then it will try the <code>__lt</code> metamethod,

600,601c599,600
< (This use of the "<code>__lt</code>" event can be removed in future versions;
< it is also slower than a real "<code>__le</code>" metamethod.)
> (This use of the <code>__lt</code> event can be removed in future versions;
> it is also slower than a real <code>__le</code> metamethod.)

604c603
< <li><b>"index": </b>
> <li><b><code>__index</code>: </b>

606d604
< 

616c614,617
< it is called with <code>table</code> and <code>key</code> as arguments.
> it is called with <code>table</code> and <code>key</code> as arguments,
> and the result of the call
> (adjusted to one value)
> is the result of the operation.

623c624
< <li><b>"newindex": </b>
> <li><b><code>__newindex</code>: </b>

625d625
< 

644c644
< Whenever there is a "newindex" metamethod,
> Whenever there is a <code>__newindex</code> metamethod,

651c651
< <li><b>"call": </b>
> <li><b><code>__call</code>: </b>

653d652
< 

659a659,661
> All results of the call
> are the result of the operation.
> (This is the only metamethod that allows multiple results.)

667c669
< In particular, the "<code>__gc</code>" metamethod works only when this order
> In particular, the <code>__gc</code> metamethod works only when this order

670a673,681
> <p>
> Because metatables are regular tables,
> they can contain arbitrary fields,
> not only the event names defined above.
> Some functions in the standard library
> (e.g., <a href="#pdf-tostring"><code>tostring</code></a>)
> use other fields in metatables for their own purposes.
> 
> 

938c949
< plus an error message.
> plus an error object.

1171c1182
< explicit escape sequences for non-text characters.
> explicit escape sequences for the non-text characters.

1204c1215
< A numeric constant with a fractional dot or an exponent 
> A numeric constant with a radix point or an exponent 

1206c1217,1219
< otherwise it denotes an integer.
> otherwise,
> if its value fits in an integer,
> it denotes an integer.

1797c1810
< the unary bitwise not (see <a href="#3.4.2">&sect;3.4.2</a>),
> the unary bitwise NOT (see <a href="#3.4.2">&sect;3.4.2</a>),

1911,1913c1924,1926
< <li><b><code>&amp;</code>: </b>bitwise and</li>
< <li><b><code>&#124;</code>: </b>bitwise or</li>
< <li><b><code>~</code>: </b>bitwise exclusive or</li>
> <li><b><code>&amp;</code>: </b>bitwise AND</li>
> <li><b><code>&#124;</code>: </b>bitwise OR</li>
> <li><b><code>~</code>: </b>bitwise exclusive OR</li>

1916c1929
< <li><b><code>~</code>: </b>unary bitwise not</li>
> <li><b><code>~</code>: </b>unary bitwise NOT</li>

1986a2000,2006
> All conversions from strings to numbers 
> accept both a dot and the current locale mark
> as the radix character.
> (The Lua lexer, however, accepts only a dot.)
> 
> 
> <p>

2795c2815
< in particular, the error message is at the top of the stack.
> in particular, the error object is at the top of the stack.

2977,2978c2997,3001
< '<code>m</code>' means the function may raise memory errors;
< '<code>e</code>' means the function may raise errors;
> '<code>m</code>' means the function may raise out-of-memory errors
> and errors running a <code>__gc</code> metamethod;
> '<code>e</code>' means the function may raise any errors
> (it can run arbitrary Lua code,
> either directly or through metamethods);

3105,3108c3128,3131
< <li><b><a name="pdf-LUA_OPBNOT"><code>LUA_OPBNOT</code></a>: </b> performs bitwise negation (<code>~</code>)</li>
< <li><b><a name="pdf-LUA_OPBAND"><code>LUA_OPBAND</code></a>: </b> performs bitwise and (<code>&amp;</code>)</li>
< <li><b><a name="pdf-LUA_OPBOR"><code>LUA_OPBOR</code></a>: </b> performs bitwise or (<code>|</code>)</li>
< <li><b><a name="pdf-LUA_OPBXOR"><code>LUA_OPBXOR</code></a>: </b> performs bitwise exclusive or (<code>~</code>)</li>
> <li><b><a name="pdf-LUA_OPBNOT"><code>LUA_OPBNOT</code></a>: </b> performs bitwise NOT (<code>~</code>)</li>
> <li><b><a name="pdf-LUA_OPBAND"><code>LUA_OPBAND</code></a>: </b> performs bitwise AND (<code>&amp;</code>)</li>
> <li><b><a name="pdf-LUA_OPBOR"><code>LUA_OPBOR</code></a>: </b> performs bitwise OR (<code>|</code>)</li>
> <li><b><a name="pdf-LUA_OPBXOR"><code>LUA_OPBXOR</code></a>: </b> performs bitwise exclusive OR (<code>~</code>)</li>

3427c3450
< <span class="apii">[-0, +0, <em>e</em>]</span>
> <span class="apii">[-0, +0, <em>m</em>]</span>

3922c3945
< memory allocation error;</li>
> memory allocation (out-of-memory) error;</li>

4131c4154
< pushes a single value on the stack (the error message),
> pushes a single value on the stack (the error object),

4140,4141c4163,4164
< then the error message returned on the stack
< is exactly the original error message.
> then the error object returned on the stack
> is exactly the original error object.

4146,4147c4169,4170
< this function will be called with the error message
< and its return value will be the message
> this function will be called with the error object
> and its return value will be the object

4153c4176
< information to the error message, such as a stack traceback.
> information to the error object, such as a stack traceback.

4287c4310
< <span class="apii">[-0, +1, <em>m</em>]</span>
> <span class="apii">[-0, +1, <em>e</em>]</span>

4319a4343,4348
> <p>
> Unlike other push functions,
> this function checks for the stack space it needs,
> including the slot for its result.
> 
> 

4489c4518
< (that is, without calling metamethods).
> (that is, without calling the <code>__eq</code> metamethod).

4516,4517c4545,4546
< The access is raw;
< that is, it does not invoke metamethods.
> The access is raw,
> that is, it does not invoke the <code>__index</code> metamethod.

4536c4565
< that is, it does not invoke metamethods.
> that is, it does not invoke the <code>__index</code> metamethod.

4587,4588c4616,4617
< The assignment is raw;
< that is, it does not invoke metamethods.
> The assignment is raw,
> that is, it does not invoke the <code>__newindex</code> metamethod.

4607,4608c4636,4637
< The assignment is raw;
< that is, it does not invoke metamethods.
> The assignment is raw,
> that is, it does not invoke <code>__newindex</code> metamethod.

4707c4736
< The error message is on the top of the stack.
> The error object is on the top of the stack.

5182c5211
< <span class="apii">[-0, +0, <em>v</em>]</span>
> <span class="apii">[-0, +0, &ndash;]</span>

5186c5215,5217
< Returns the address of the version number stored in the Lua core.
> Returns the address of the version number
> (a C static variable)
> stored in the Lua core.

5290c5321
< from inside a line hook (see <a href="#4.9">&sect;4.9</a>).
> from inside a line or a count hook (see <a href="#4.9">&sect;4.9</a>).

5292c5323
< (probably in the form of <a href="#lua_yield"><code>lua_yield</code></a>),
> (probably in the form of <a href="#lua_yield"><code>lua_yield</code></a>) and no results,

5707c5738
< it is formed by a bitwise or of the constants
> it is formed by a bitwise OR of the constants

6259c6290
< <span class="apii">[-0, +0, &ndash;]</span>
> <span class="apii">[-0, +0, <em>v</em>]</span>

6475c6506
< <span class="apii">[-0, +1, <em>e</em>]</span>
> <span class="apii">[-0, +1, <em>m</em>]</span>

6486c6517
< <span class="apii">[-0, +1, <em>e</em>]</span>
> <span class="apii">[-0, +1, <em>m</em>]</span>

6636a6668,6688
> <hr><h3><a name="luaL_opt"><code>luaL_opt</code></a></h3><p>
> <span class="apii">[-0, +0, <em>e</em>]</span>
> <pre>T luaL_opt (L, func, arg, dflt);</pre>
> 
> <p>
> This macro is defined as follows:
> 
> <pre>
>      (lua_isnoneornil(L,(arg)) ? (dflt) : func(L,(arg)))
> </pre><p>
> In words, if the argument <code>arg</code> is nil or absent,
> the macro results in the default <code>dflt</code>.
> Otherwise, it results in the result of calling <code>func</code>
> with the state <code>L</code> and the argument index <code>arg</code> as
> parameters.
> Note that it evaluates the expression <code>dflt</code> only if needed.
> 
> 
> 
> 
> 

6934c6986
< If the value has a metatable with a <code>"__tostring"</code> field,
> If the value has a metatable with a <code>__tostring</code> field,

7223c7275
< if the object's metatable has a <code>"__metatable"</code> field,
> if the object's metatable has a <code>__metatable</code> field,

7427c7479
< without invoking any metamethod.
> without invoking the <code>__eq</code> metamethod.

7436c7488
< without invoking any metamethod.
> without invoking the <code>__index</code> metamethod.

7447c7499
< without invoking any metamethod.
> without invoking the <code>__len</code> metamethod.

7456c7508
< without invoking any metamethod.
> without invoking the <code>__newindex</code> metamethod.

7492c7544
< If the original metatable has a <code>"__metatable"</code> field,
> If the original metatable has a <code>__metatable</code> field,

7544c7596
< If the metatable of <code>v</code> has a <code>"__tostring"</code> field,
> If the metatable of <code>v</code> has a <code>__tostring</code> field,

8186a8239,8241
> 
> 
> <p>

8209c8264,8269
< Option <code>q</code> expects a string.
> When Lua is compiled with a C89 compiler,
> options <code>A</code> and <code>a</code> (hexadecimal floats)
> do not support any modifier (flags, width, length).
> 
> 
> <p>

8217,8222d8276
< <p>
< When Lua is compiled with a non-C99 compiler,
< options <code>A</code> and <code>a</code> (hexadecimal floats)
< do not support any modifier (flags, width, length).
< 
< 

8550a8605,8612
> You can put a closing square bracket in a set
> by positioning it as the first character in the set.
> You can put an hyphen in a set
> by positioning it as the first or the last character in the set.
> (You can also use an escape for both cases.)
> 
> 
> <p>

8928,8929c8990,8991
< Moves elements from table <code>a1</code> to table <code>a2</code>.
< This function performs the equivalent to the following
> Moves elements from table <code>a1</code> to table <code>a2</code>,
> performing the equivalent to the following

8936a8999,9002
> <p>
> Returns the destination table <code>a2</code>.
> 
> 

9460,9461c9526,9527
< It returns a new file handle,
< or, in case of errors, <b>nil</b> plus an error message.
> In case of success,
> it returns a new file handle.

9526c9592,9593
< Returns a handle for a temporary file.
> In case of success,
> returns a handle for a temporary file.

9804,9805c9871,9872
< <code>wday</code> (weekday, Sunday is&nbsp;1),
< <code>yday</code> (day of the year),
> <code>wday</code> (weekday, 1&ndash;7, Sunday is&nbsp;1),
> <code>yday</code> (day of the year, 1&ndash;366),

10507a10575,10582
> If the global variable <a name="pdf-_PROMPT"><code>_PROMPT</code></a> contains a string,
> then its value is used as the prompt.
> Similarly, if the global variable <a name="pdf-_PROMPT2"><code>_PROMPT2</code></a> contains a string,
> its value is used as the secondary prompt
> (issued during incomplete statements).
> 
> 
> <p>

10828c10903
< Wed Nov 25 15:19:10 BRST 2015
> Mon May 30 13:11:08 BRT 2016

10831c10906
< Last change: revised for Lua 5.3.2
> Last change: revised for Lua 5.3.3

doc/readme.html

279c279
< <LI> integer division
> <LI> floor division

331c331
< Copyright &copy; 1994&ndash;2015 Lua.org, PUC-Rio.
> Copyright &copy; 1994&ndash;2016 Lua.org, PUC-Rio.

358c358
< Mon Jun  1 21:48:24 BRT 2015
> Tue Feb  2 22:25:27 BRST 2016

361c361
< Last change: revised for Lua 5.3.1
> Last change: revised for Lua 5.3.3

src/lapi.c

2c2
< ** $Id: lapi.c,v 2.257 2015/11/02 18:48:07 roberto Exp $
> ** $Id: lapi.c,v 2.259 2016/02/29 14:27:14 roberto Exp $

380a381
>     luaO_tostring(L, o);

383d383
<     luaO_tostring(L, o);

482d481
<   luaC_checkGC(L);

485a485
>   luaC_checkGC(L);

497d496
<     luaC_checkGC(L);

502a502
>   luaC_checkGC(L);

512d511
<   luaC_checkGC(L);

513a513
>   luaC_checkGC(L);

523d522
<   luaC_checkGC(L);

526a526
>   luaC_checkGC(L);

541d540
<     luaC_checkGC(L);

551a551
>   luaC_checkGC(L);

588c588
<   const TValue *aux;
>   const TValue *slot;

590,591c590,591
<   if (luaV_fastget(L, t, str, aux, luaH_getstr)) {
<     setobj2s(L, L->top, aux);
>   if (luaV_fastget(L, t, str, slot, luaH_getstr)) {
>     setobj2s(L, L->top, slot);

597c597
<     luaV_finishget(L, t, L->top - 1, L->top - 1, aux);
>     luaV_finishget(L, t, L->top - 1, L->top - 1, slot);

629c629
<   const TValue *aux;
>   const TValue *slot;

632,633c632,633
<   if (luaV_fastget(L, t, n, aux, luaH_getint)) {
<     setobj2s(L, L->top, aux);
>   if (luaV_fastget(L, t, n, slot, luaH_getint)) {
>     setobj2s(L, L->top, slot);

639c639
<     luaV_finishget(L, t, L->top - 1, L->top - 1, aux);
>     luaV_finishget(L, t, L->top - 1, L->top - 1, slot);

686d685
<   luaC_checkGC(L);

691a691
>   luaC_checkGC(L);

743c743
<   const TValue *aux;
>   const TValue *slot;

746c746
<   if (luaV_fastset(L, t, str, aux, luaH_getstr, L->top - 1))
>   if (luaV_fastset(L, t, str, slot, luaH_getstr, L->top - 1))

751c751
<     luaV_finishset(L, t, L->top - 1, L->top - 2, aux);
>     luaV_finishset(L, t, L->top - 1, L->top - 2, slot);

784c784
<   const TValue *aux;
>   const TValue *slot;

788c788
<   if (luaV_fastset(L, t, n, aux, luaH_getint, L->top - 1))
>   if (luaV_fastset(L, t, n, slot, luaH_getint, L->top - 1))

793c793
<     luaV_finishset(L, t, L->top - 1, L->top - 2, aux);
>     luaV_finishset(L, t, L->top - 1, L->top - 2, slot);

1143d1142
<     luaC_checkGC(L);

1150a1150
>   luaC_checkGC(L);

1186d1185
<   luaC_checkGC(L);

1189a1189
>   luaC_checkGC(L);

src/lauxlib.c

2c2
< ** $Id: lauxlib.c,v 1.284 2015/11/19 19:16:22 roberto Exp $
> ** $Id: lauxlib.c,v 1.286 2016/01/08 15:33:09 roberto Exp $

20c20,21
< /* This file uses only the official API of Lua.
> /*
> ** This file uses only the official API of Lua.

200a202,205
> /*
> ** The use of 'lua_pushfstring' ensures this function does not
> ** need reserved stack space when called.
> */

210c215
<   lua_pushliteral(L, "");  /* else, no information available... */
>   lua_pushfstring(L, "");  /* else, no information available... */

213a219,223
> /*
> ** Again, the use of 'lua_pushvfstring' ensures this function does
> ** not need reserved stack space when called. (At worst, it generates
> ** an error with "stack overflow" instead of the given message.)
> */

351a362,368
> /*
> ** Ensures the stack has at least 'space' extra slots, raising an error
> ** if it cannot fulfill the request. (The error handling needs a few
> ** extra slots to format the error message. In case of an error without
> ** this extra space, Lua will generate the same 'stack overflow' error,
> ** but without 'msg'.)
> */

353,355c370
<   /* keep some extra space to run error routines, if needed */
<   const int extra = LUA_MINSTACK;
<   if (!lua_checkstack(L, space + extra)) {
>   if (!lua_checkstack(L, space)) {

681c696
<     } while (c != EOF && c != '\n') ;
>     } while (c != EOF && c != '\n');

src/lbaselib.c

2c2
< ** $Id: lbaselib.c,v 1.312 2015/10/29 15:21:04 roberto Exp $
> ** $Id: lbaselib.c,v 1.313 2016/04/11 19:18:40 roberto Exp $

105,106c105,106
<   if (lua_isstring(L, 1) && level > 0) {  /* add extra information? */
<     luaL_where(L, level);
>   if (lua_type(L, 1) == LUA_TSTRING && level > 0) {
>     luaL_where(L, level);   /* add extra information */

254,256c254,255
< ** This function will use either 'ipairsaux' or 'ipairsaux_raw' to
< ** traverse a table, depending on whether the table has metamethods
< ** that can affect the traversal.
> ** 'ipairs' function. Returns 'ipairsaux', given "table", 0.
> ** (The given "table" may not be a table.)

src/lcode.c

2c2
< ** $Id: lcode.c,v 2.103 2015/11/19 19:16:22 roberto Exp $
> ** $Id: lcode.c,v 2.109 2016/05/13 19:09:21 roberto Exp $

38a39,42
> /*
> ** If expression is a numeric constant, fills 'v' with its value
> ** and returns 1. Otherwise, returns 0.
> */

53a58,63
> /*
> ** Create a OP_LOADNIL instruction, but try to optimize: if the previous
> ** instruction is also OP_LOADNIL and ranges are compatible, adjust
> ** range of previous instruction instead of emitting a new one. (For
> ** instance, 'local a; local b' will generate a single opcode.)
> */

59,60c69,70
<     if (GET_OPCODE(*previous) == OP_LOADNIL) {
<       int pfrom = GETARG_A(*previous);
>     if (GET_OPCODE(*previous) == OP_LOADNIL) {  /* previous is LOADNIL? */
>       int pfrom = GETARG_A(*previous);  /* get previous range */

75a86,135
> /*
> ** Gets the destination address of a jump instruction. Used to traverse
> ** a list of jumps.
> */ 
> static int getjump (FuncState *fs, int pc) {
>   int offset = GETARG_sBx(fs->f->code[pc]);
>   if (offset == NO_JUMP)  /* point to itself represents end of list */
>     return NO_JUMP;  /* end of list */
>   else
>     return (pc+1)+offset;  /* turn offset into absolute position */
> }
> 
> 
> /*
> ** Fix jump instruction at position 'pc' to jump to 'dest'.
> ** (Jump addresses are relative in Lua)
> */
> static void fixjump (FuncState *fs, int pc, int dest) {
>   Instruction *jmp = &fs->f->code[pc];
>   int offset = dest - (pc + 1);
>   lua_assert(dest != NO_JUMP);
>   if (abs(offset) > MAXARG_sBx)
>     luaX_syntaxerror(fs->ls, "control structure too long");
>   SETARG_sBx(*jmp, offset);
> }
> 
> 
> /*
> ** Concatenate jump-list 'l2' into jump-list 'l1'
> */
> void luaK_concat (FuncState *fs, int *l1, int l2) {
>   if (l2 == NO_JUMP) return;  /* nothing to concatenate? */
>   else if (*l1 == NO_JUMP)  /* no original list? */
>     *l1 = l2;  /* 'l1' points to 'l2' */
>   else {
>     int list = *l1;
>     int next;
>     while ((next = getjump(fs, list)) != NO_JUMP)  /* find last element */
>       list = next;
>     fixjump(fs, list, l2);  /* last element links to 'l2' */
>   }
> }
> 
> 
> /*
> ** Create a jump instruction and return its position, so its destination
> ** can be fixed later (with 'fixjump'). If there are jumps to
> ** this position (kept in 'jpc'), link them all together so that
> ** 'patchlistaux' will fix all them directly to the final destination.
> */

79c139
<   fs->jpc = NO_JUMP;
>   fs->jpc = NO_JUMP;  /* no more jumps to here */

85a146,148
> /*
> ** Code a 'return' instruction
> */

90a154,157
> /*
> ** Code a "conditional jump", that is, a test or comparison opcode
> ** followed by a jump. Return jump position.
> */

97,106d163
< static void fixjump (FuncState *fs, int pc, int dest) {
<   Instruction *jmp = &fs->f->code[pc];
<   int offset = dest-(pc+1);
<   lua_assert(dest != NO_JUMP);
<   if (abs(offset) > MAXARG_sBx)
<     luaX_syntaxerror(fs->ls, "control structure too long");
<   SETARG_sBx(*jmp, offset);
< }
< 
< 

117,125c174,178
< static int getjump (FuncState *fs, int pc) {
<   int offset = GETARG_sBx(fs->f->code[pc]);
<   if (offset == NO_JUMP)  /* point to itself represents end of list */
<     return NO_JUMP;  /* end of list */
<   else
<     return (pc+1)+offset;  /* turn offset into absolute position */
< }
< 
< 
> /*
> ** Returns the position of the instruction "controlling" a given
> ** jump (that is, its condition), or the jump itself if it is
> ** unconditional.
> */

136,137c189,193
< ** check whether list has any jump that do not produce a value
< ** (or produce an inverted value)
> ** Patch destination register for a TESTSET instruction.
> ** If instruction in position 'node' is not a TESTSET, return 0 ("fails").
> ** Otherwise, if 'reg' is not 'NO_REG', set it as the destination
> ** register. Otherwise, change instruction to a simple 'TEST' (produces
> ** no register value)

139,147d194
< static int need_value (FuncState *fs, int list) {
<   for (; list != NO_JUMP; list = getjump(fs, list)) {
<     Instruction i = *getjumpcontrol(fs, list);
<     if (GET_OPCODE(i) != OP_TESTSET) return 1;
<   }
<   return 0;  /* not found */
< }
< 
< 

154c201,203
<   else  /* no register to put value or register already has the value */
>   else {
>      /* no register to put value or register already has the value;
>         change instruction to simple test */

156c205
< 
>   }

160a210,212
> /*
> ** Traverse a list of tests ensuring no one produces a value
> */

166a219,223
> /*
> ** Traverse a list of tests, patching their destination address and
> ** registers: tests producing values jump to 'vtarget' (and put their
> ** values in 'reg'), other tests jump to 'dtarget'.
> */

179a237,241
> /*
> ** Ensure all pending jumps to current position are fixed (jumping
> ** to current position with no values) and reset list of pending
> ** jumps
> */

185a248,262
> /*
> ** Add elements in 'list' to list of pending jumps to "here"
> ** (current position)
> */
> void luaK_patchtohere (FuncState *fs, int list) {
>   luaK_getlabel(fs);  /* mark "here" as a jump target */
>   luaK_concat(fs, &fs->jpc, list);
> }
> 
> 
> /*
> ** Path all jumps in 'list' to jump to 'target'.
> ** (The assert means that we cannot fix a jump to a forward address
> ** because we only know addresses once code is generated.)
> */

187,188c264,265
<   if (target == fs->pc)
<     luaK_patchtohere(fs, list);
>   if (target == fs->pc)  /* 'target' is current position? */
>     luaK_patchtohere(fs, list);  /* add list to pending jumps */

195a273,277
> /*
> ** Path all jumps in 'list' to close upvalues up to given 'level'
> ** (The assertion checks that jumps either were closing nothing
> ** or were closing higher levels, from inner blocks.)
> */

198,199c280
<   while (list != NO_JUMP) {
<     int next = getjump(fs, list);
>   for (; list != NO_JUMP; list = getjump(fs, list)) {

204,224d284
<     list = next;
<   }
< }
< 
< 
< void luaK_patchtohere (FuncState *fs, int list) {
<   luaK_getlabel(fs);
<   luaK_concat(fs, &fs->jpc, list);
< }
< 
< 
< void luaK_concat (FuncState *fs, int *l1, int l2) {
<   if (l2 == NO_JUMP) return;
<   else if (*l1 == NO_JUMP)
<     *l1 = l2;
<   else {
<     int list = *l1;
<     int next;
<     while ((next = getjump(fs, list)) != NO_JUMP)  /* find last element */
<       list = next;
<     fixjump(fs, list, l2);

228a289,292
> /*
> ** Emit instruction 'i', checking for array sizes and saving also its
> ** line information. Return 'i' position.
> */

243a308,311
> /*
> ** Format and emit an 'iABC' instruction. (Assertions check consistency
> ** of parameters versus opcode.)
> */

252a321,323
> /*
> ** Format and emit an 'iABx' instruction.
> */

260a332,334
> /*
> ** Emit an "extra argument" instruction (format 'iAx')
> */

266a341,345
> /*
> ** Emit a "load constant" instruction, using either 'OP_LOADK'
> ** (if constant index 'k' fits in 18 bits) or an 'OP_LOADKX'
> ** instruction with "extra argument".
> */

277a357,360
> /*
> ** Check register-stack level, keeping track of its maximum size
> ** in field 'maxstacksize'
> */

288a372,374
> /*
> ** Reserve 'n' registers in register stack
> */

294a381,385
> /*
> ** Free register 'reg', if it is neither a constant index nor
> ** a local variable.
> )
> */

302a394,396
> /*
> ** Free register used by expression 'e' (if any)
> */

309a404,422
> ** Free registers used by expressions 'e1' and 'e2' (if any) in proper
> ** order.
> */
> static void freeexps (FuncState *fs, expdesc *e1, expdesc *e2) {
>   int r1 = (e1->k == VNONRELOC) ? e1->u.info : -1;
>   int r2 = (e2->k == VNONRELOC) ? e2->u.info : -1;
>   if (r1 > r2) {
>     freereg(fs, r1);
>     freereg(fs, r2);
>   }
>   else {
>     freereg(fs, r2);
>     freereg(fs, r1);
>   }
> }
> 
> 
> /*
> ** Add constant 'v' to prototype's list of constants (field 'k').

311c424,426
< ** and try to reuse constants
> ** and try to reuse constants. Because some values should not be used
> ** as keys (nil cannot be a key, integer keys can collapse with float
> ** keys), the caller must provide a useful 'key' for indexing the cache.

339a455,457
> /*
> ** Add a string to list of constants and return its index.
> */

343c461
<   return addk(fs, &o, &o);
>   return addk(fs, &o, &o);  /* use string itself as key */

348,350c466,469
< ** Integers use userdata as keys to avoid collision with floats with same
< ** value; conversion to 'void*' used only for hashing, no "precision"
< ** problems
> ** Add an integer to list of constants and return its index.
> ** Integers use userdata as keys to avoid collision with floats with
> ** same value; conversion to 'void*' is used only for hashing, so there
> ** are no "precision" problems.

359c478,480
< 
> /*
> ** Add a float to list of constants and return its index.
> */

363c484
<   return addk(fs, &o, &o);
>   return addk(fs, &o, &o);  /* use number itself as key */

366a488,490
> /*
> ** Add a boolean to list of constants and return its index.
> */

370c494
<   return addk(fs, &o, &o);
>   return addk(fs, &o, &o);  /* use boolean itself as key */

373a498,500
> /*
> ** Add nil to list of constants and return its index.
> */

382a510,514
> /*
> ** Fix an expression to return the number of results 'nresults'.
> ** Either 'e' is a multi-ret expression (function call or vararg)
> ** or 'nresults' is LUA_MULTRET (as any expression can satisfy that).
> */

385c517
<     SETARG_C(getcode(fs, e), nresults+1);
>     SETARG_C(getinstruction(fs, e), nresults + 1);

388,389c520,522
<     SETARG_B(getcode(fs, e), nresults+1);
<     SETARG_A(getcode(fs, e), fs->freereg);
>     Instruction *pc = &getinstruction(fs, e);
>     SETARG_B(*pc, nresults + 1);
>     SETARG_A(*pc, fs->freereg);

391a525
>   else lua_assert(nresults == LUA_MULTRET);

394a529,538
> /*
> ** Fix an expression to return one result.
> ** If expression is not a multi-ret expression (function call or
> ** vararg), it already returns one result, so nothing needs to be done.
> ** Function calls become VNONRELOC expressions (as its result comes
> ** fixed in the base register of the call), while vararg expressions
> ** become VRELOCABLE (as OP_VARARG puts its results where it wants).
> ** (Calls are created returning one result, so that does not need
> ** to be fixed.)
> */

397,398c541,544
<     e->k = VNONRELOC;
<     e->u.info = GETARG_A(getcode(fs, e));
>     /* already returns 1 value */
>     lua_assert(GETARG_C(getinstruction(fs, e)) == 2);
>     e->k = VNONRELOC;  /* result has fixed position */
>     e->u.info = GETARG_A(getinstruction(fs, e));

401c547
<     SETARG_B(getcode(fs, e), 2);
>     SETARG_B(getinstruction(fs, e), 2);

406a553,555
> /*
> ** Ensure that expression 'e' is not a variable.
> */

409,410c558,559
<     case VLOCAL: {
<       e->k = VNONRELOC;
>     case VLOCAL: {  /* already in a register */
>       e->k = VNONRELOC;  /* becomes a non-relocatable value */

413c562
<     case VUPVAL: {
>     case VUPVAL: {  /* move value to some (pending) register */

419c568
<       OpCode op = OP_GETTABUP;  /* assume 't' is in an upvalue */
>       OpCode op;

421c570
<       if (e->u.ind.vt == VLOCAL) {  /* 't' is in a register? */
>       if (e->u.ind.vt == VLOCAL) {  /* is 't' in a register? */

424a574,577
>       else {
>         lua_assert(e->u.ind.vt == VUPVAL);
>         op = OP_GETTABUP;  /* 't' is in an upvalue */
>       }

429,430c582
<     case VVARARG:
<     case VCALL: {
>     case VVARARG: case VCALL: {

439,444c591,594
< static int code_label (FuncState *fs, int A, int b, int jump) {
<   luaK_getlabel(fs);  /* those instructions may be jump targets */
<   return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump);
< }
< 
< 
> /*
> ** Ensures expression value is in register 'reg' (and therefore
> ** 'e' will become a non-relocatable expression).
> */

469,470c619,620
<       Instruction *pc = &getcode(fs, e);
<       SETARG_A(*pc, reg);
>       Instruction *pc = &getinstruction(fs, e);
>       SETARG_A(*pc, reg);  /* instruction will put result in 'reg' */

479c629
<       lua_assert(e->k == VVOID || e->k == VJMP);
>       lua_assert(e->k == VJMP);

487a638,640
> /*
> ** Ensures expression value is in any register.
> */

489,491c642,662
<   if (e->k != VNONRELOC) {
<     luaK_reserveregs(fs, 1);
<     discharge2reg(fs, e, fs->freereg-1);
>   if (e->k != VNONRELOC) {  /* no fixed register yet? */
>     luaK_reserveregs(fs, 1);  /* get a register */
>     discharge2reg(fs, e, fs->freereg-1);  /* put value there */
>   }
> }
> 
> 
> static int code_loadbool (FuncState *fs, int A, int b, int jump) {
>   luaK_getlabel(fs);  /* those instructions may be jump targets */
>   return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump);
> }
> 
> 
> /*
> ** check whether list has any jump that do not produce a value
> ** or produce an inverted value
> */
> static int need_value (FuncState *fs, int list) {
>   for (; list != NO_JUMP; list = getjump(fs, list)) {
>     Instruction i = *getjumpcontrol(fs, list);
>     if (GET_OPCODE(i) != OP_TESTSET) return 1;

492a664
>   return 0;  /* not found */

495a668,674
> /*
> ** Ensures final expression result (including results from its jump
> ** lists) is in register 'reg'.
> ** If expression has jumps, need to patch these jumps either to
> ** its final position or to "load" instructions (for those tests
> ** that do not produce values).
> */

498c677
<   if (e->k == VJMP)
>   if (e->k == VJMP)  /* expression itself is a test? */

506,507c685,686
<       p_f = code_label(fs, reg, 0, 1);
<       p_t = code_label(fs, reg, 1, 0);
>       p_f = code_loadbool(fs, reg, 0, 1);
>       p_t = code_loadbool(fs, reg, 1, 0);

519a699,702
> /*
> ** Ensures final expression result (including results from its jump
> ** lists) is in next available register.
> */

527a711,714
> /*
> ** Ensures final expression result (including results from its jump
> ** lists) is in some (any) register and return that register.
> */

530,531c717,719
<   if (e->k == VNONRELOC) {
<     if (!hasjumps(e)) return e->u.info;  /* exp is already in a register */
>   if (e->k == VNONRELOC) {  /* expression already has a register? */
>     if (!hasjumps(e))  /* no jumps? */
>       return e->u.info;  /* result is already in a register */

533c721
<       exp2reg(fs, e, e->u.info);  /* put value on it */
>       exp2reg(fs, e, e->u.info);  /* put final result in it */

537c725
<   luaK_exp2nextreg(fs, e);  /* default */
>   luaK_exp2nextreg(fs, e);  /* otherwise, use next available register */

541a730,733
> /*
> ** Ensures final expression result is either in a register or in an
> ** upvalue.
> */

547a740,743
> /*
> ** Ensures final expression result is either in a register or it is
> ** a constant.
> */

555a752,757
> /*
> ** Ensures final expression result is in a valid R/K index
> ** (that is, it is either in a register or in 'k' with an index
> ** in the range of R/K indices).
> ** Returns R/K index.
> */  

558,579c760,766
<   switch (e->k) {
<     case VTRUE:
<     case VFALSE:
<     case VNIL: {
<       if (fs->nk <= MAXINDEXRK) {  /* constant fits in RK operand? */
<         e->u.info = (e->k == VNIL) ? nilK(fs) : boolK(fs, (e->k == VTRUE));
<         e->k = VK;
<         return RKASK(e->u.info);
<       }
<       else break;
<     }
<     case VKINT: {
<       e->u.info = luaK_intK(fs, e->u.ival);
<       e->k = VK;
<       goto vk;
<     }
<     case VKFLT: {
<       e->u.info = luaK_numberK(fs, e->u.nval);
<       e->k = VK;
<     }
<     /* FALLTHROUGH */
<     case VK: {
>   switch (e->k) {  /* move constants to 'k' */
>     case VTRUE: e->u.info = boolK(fs, 1); goto vk;
>     case VFALSE: e->u.info = boolK(fs, 0); goto vk;
>     case VNIL: e->u.info = nilK(fs); goto vk;
>     case VKINT: e->u.info = luaK_intK(fs, e->u.ival); goto vk;
>     case VKFLT: e->u.info = luaK_numberK(fs, e->u.nval); goto vk;
>     case VK:

580a768
>       e->k = VK;

584d771
<     }

591a779,781
> /*
> ** Generate code to store result of expression 'ex' into variable 'var'.
> */

596c786
<       exp2reg(fs, ex, var->u.info);
>       exp2reg(fs, ex, var->u.info);  /* compute 'ex' into proper place */

610,613c800
<     default: {
<       lua_assert(0);  /* invalid var kind to store */
<       break;
<     }
>     default: lua_assert(0);  /* invalid var kind to store */

618a806,808
> /*
> ** Emit SELF instruction (convert expression 'e' into 'e:key(e,').
> */

625c815
<   e->k = VNONRELOC;
>   e->k = VNONRELOC;  /* self expression has a fixed register */

632c822,825
< static void invertjump (FuncState *fs, expdesc *e) {
> /*
> ** Negate condition 'e' (where 'e' is a comparison).
> */
> static void negatecondition (FuncState *fs, expdesc *e) {

639a833,838
> /*
> ** Emit instruction to jump if 'e' is 'cond' (that is, if 'cond'
> ** is true, code will jump if 'e' is true.) Return jump position.
> ** Optimize when 'e' is 'not' something, inverting the condition
> ** and removing the 'not'.
> */

642c841
<     Instruction ie = getcode(fs, e);
>     Instruction ie = getinstruction(fs, e);

654a854,856
> /*
> ** Emit code to go through if 'e' is true, jump otherwise.
> */

656c858
<   int pc;  /* pc of last jump */
>   int pc;  /* pc of new jump */

659,661c861,863
<     case VJMP: {
<       invertjump(fs, e);
<       pc = e->u.info;
>     case VJMP: {  /* condition? */
>       negatecondition(fs, e);  /* jump when it is false */
>       pc = e->u.info;  /* save jump position */

669c871
<       pc = jumponcond(fs, e, 0);
>       pc = jumponcond(fs, e, 0);  /* jump when false */

673,674c875,876
<   luaK_concat(fs, &e->f, pc);  /* insert last jump in 'f' list */
<   luaK_patchtohere(fs, e->t);
>   luaK_concat(fs, &e->f, pc);  /* insert new jump in false list */
>   luaK_patchtohere(fs, e->t);  /* true list jumps to here (to go through) */

678a881,883
> /*
> ** Emit code to go through if 'e' is false, jump otherwise.
> */

680c885
<   int pc;  /* pc of last jump */
>   int pc;  /* pc of new jump */

684c889
<       pc = e->u.info;
>       pc = e->u.info;  /* already jump if true */

692c897
<       pc = jumponcond(fs, e, 1);
>       pc = jumponcond(fs, e, 1);  /* jump if true */

696,697c901,902
<   luaK_concat(fs, &e->t, pc);  /* insert last jump in 't' list */
<   luaK_patchtohere(fs, e->f);
>   luaK_concat(fs, &e->t, pc);  /* insert new jump in 't' list */
>   luaK_patchtohere(fs, e->f);  /* false list jumps to here (to go through) */

701a907,909
> /*
> ** Code 'not e', doing constant folding.
> */

706c914
<       e->k = VTRUE;
>       e->k = VTRUE;  /* true == not nil == not false */

710c918
<       e->k = VFALSE;
>       e->k = VFALSE;  /* false == not "x" == not 0.5 == not 1 == not true */

714c922
<       invertjump(fs, e);
>       negatecondition(fs, e);

725,728c933
<     default: {
<       lua_assert(0);  /* cannot happen */
<       break;
<     }
>     default: lua_assert(0);  /* cannot happen */

732c937
<   removevalues(fs, e->f);
>   removevalues(fs, e->f);  /* values are useless when negated */

736a942,945
> /*
> ** Create expression 't[k]'. 't' must have its final result already in a
> ** register or upvalue.
> */

738,742c947,950
<   lua_assert(!hasjumps(t));
<   t->u.ind.t = t->u.info;
<   t->u.ind.idx = luaK_exp2RK(fs, k);
<   t->u.ind.vt = (t->k == VUPVAL) ? VUPVAL
<                                  : check_exp(vkisinreg(t->k), VLOCAL);
>   lua_assert(!hasjumps(t) && (vkisinreg(t->k) || t->k == VUPVAL));
>   t->u.ind.t = t->u.info;  /* register or upvalue index */
>   t->u.ind.idx = luaK_exp2RK(fs, k);  /* R/K index for key */
>   t->u.ind.vt = (t->k == VUPVAL) ? VUPVAL : VLOCAL;

748c956,958
< ** return false if folding can raise an error
> ** Return false if folding can raise an error.
> ** Bitwise operations need operands convertible to integers; division
> ** operations cannot have 0 as divisor.

765c975,976
< ** Try to "constant-fold" an operation; return 1 iff successful
> ** Try to "constant-fold" an operation; return 1 iff successful.
> ** (In this case, 'e1' has the final result.)

776c987
<   else {  /* folds neither NaN nor 0.0 (to avoid collapsing with -0.0) */
>   else {  /* folds neither NaN nor 0.0 (to avoid problems with -0.0) */

788,791c999,1015
< ** Code for binary and unary expressions that "produce values"
< ** (arithmetic operations, bitwise operations, concat, length). First
< ** try to do constant folding (only for numeric [arithmetic and
< ** bitwise] operations, which is what 'lua_arith' accepts).
> ** Emit code for unary expressions that "produce values"
> ** (everything but 'not').
> ** Expression to produce final result will be encoded in 'e'.
> */
> static void codeunexpval (FuncState *fs, OpCode op, expdesc *e, int line) {
>   int r = luaK_exp2anyreg(fs, e);  /* opcodes operate only on registers */
>   freeexp(fs, e);
>   e->u.info = luaK_codeABC(fs, op, 0, r, 0);  /* generate opcode */
>   e->k = VRELOCABLE;  /* all those operations are relocatable */
>   luaK_fixline(fs, line);
> }
> 
> 
> /*
> ** Emit code for binary expressions that "produce values"
> ** (everything but logical operators 'and'/'or' and comparison
> ** operators).

794,821c1018,1025
< static void codeexpval (FuncState *fs, OpCode op,
<                         expdesc *e1, expdesc *e2, int line) {
<   lua_assert(op >= OP_ADD);
<   if (op <= OP_BNOT && constfolding(fs, (op - OP_ADD) + LUA_OPADD, e1, e2))
<     return;  /* result has been folded */
<   else {
<     int o1, o2;
<     /* move operands to registers (if needed) */
<     if (op == OP_UNM || op == OP_BNOT || op == OP_LEN) {  /* unary op? */
<       o2 = 0;  /* no second expression */
<       o1 = luaK_exp2anyreg(fs, e1);  /* cannot operate on constants */
<     }
<     else {  /* regular case (binary operators) */
<       o2 = luaK_exp2RK(fs, e2);  /* both operands are "RK" */
<       o1 = luaK_exp2RK(fs, e1);
<     }
<     if (o1 > o2) {  /* free registers in proper order */
<       freeexp(fs, e1);
<       freeexp(fs, e2);
<     }
<     else {
<       freeexp(fs, e2);
<       freeexp(fs, e1);
<     }
<     e1->u.info = luaK_codeABC(fs, op, 0, o1, o2);  /* generate opcode */
<     e1->k = VRELOCABLE;  /* all those operations are relocatable */
<     luaK_fixline(fs, line);
<   }
> static void codebinexpval (FuncState *fs, OpCode op,
>                            expdesc *e1, expdesc *e2, int line) {
>   int rk1 = luaK_exp2RK(fs, e1);  /* both operands are "RK" */
>   int rk2 = luaK_exp2RK(fs, e2);
>   freeexps(fs, e1, e2);
>   e1->u.info = luaK_codeABC(fs, op, 0, rk1, rk2);  /* generate opcode */
>   e1->k = VRELOCABLE;  /* all those operations are relocatable */
>   luaK_fixline(fs, line);

825,834c1029,1053
< static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1,
<                                                           expdesc *e2) {
<   int o1 = luaK_exp2RK(fs, e1);
<   int o2 = luaK_exp2RK(fs, e2);
<   freeexp(fs, e2);
<   freeexp(fs, e1);
<   if (cond == 0 && op != OP_EQ) {
<     int temp;  /* exchange args to replace by '<' or '<=' */
<     temp = o1; o1 = o2; o2 = temp;  /* o1 <==> o2 */
<     cond = 1;
> /*
> ** Emit code for comparisons.
> ** 'e1' was already put in R/K form by 'luaK_infix'.
> */
> static void codecomp (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) {
>   int rk1 = (e1->k == VK) ? RKASK(e1->u.info)
>                           : check_exp(e1->k == VNONRELOC, e1->u.info);
>   int rk2 = luaK_exp2RK(fs, e2);
>   freeexps(fs, e1, e2);
>   switch (opr) {
>     case OPR_NE: {  /* '(a ~= b)' ==> 'not (a == b)' */
>       e1->u.info = condjump(fs, OP_EQ, 0, rk1, rk2);
>       break;
>     }
>     case OPR_GT: case OPR_GE: {
>       /* '(a > b)' ==> '(b < a)';  '(a >= b)' ==> '(b <= a)' */
>       OpCode op = cast(OpCode, (opr - OPR_NE) + OP_EQ);
>       e1->u.info = condjump(fs, op, 1, rk2, rk1);  /* invert operands */
>       break;
>     }
>     default: {  /* '==', '<', '<=' use their own opcodes */
>       OpCode op = cast(OpCode, (opr - OPR_EQ) + OP_EQ);
>       e1->u.info = condjump(fs, op, 1, rk1, rk2);
>       break;
>     }

836d1054
<   e1->u.info = condjump(fs, op, cond, o1, o2);

840a1059,1061
> /*
> ** Aplly prefix operation 'op' to expression 'e'.
> */

842,843c1063
<   expdesc e2;
<   e2.t = e2.f = NO_JUMP; e2.k = VKINT; e2.u.ival = 0;
>   static expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP};  /* fake 2nd operand */

845,846c1065,1070
<     case OPR_MINUS: case OPR_BNOT: case OPR_LEN: {
<       codeexpval(fs, cast(OpCode, (op - OPR_MINUS) + OP_UNM), e, &e2, line);
>     case OPR_MINUS: case OPR_BNOT:
>       if (constfolding(fs, op + LUA_OPUNM, e, &ef))
>         break;
>       /* FALLTHROUGH */
>     case OPR_LEN:
>       codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line);

848d1071
<     }

854a1078,1081
> /*
> ** Process 1st operand 'v' of binary operation 'op' before reading
> ** 2nd operand.
> */

858c1085
<       luaK_goiftrue(fs, v);
>       luaK_goiftrue(fs, v);  /* go ahead only if 'v' is true */

862c1089
<       luaK_goiffalse(fs, v);
>       luaK_goiffalse(fs, v);  /* go ahead only if 'v' is false */

874c1101,1103
<       if (!tonumeral(v, NULL)) luaK_exp2RK(fs, v);
>       if (!tonumeral(v, NULL))
>         luaK_exp2RK(fs, v);
>       /* else keep numeral, which may be folded with 2nd operand */

884a1114,1119
> /*
> ** Finalize code for binary operation, after reading 2nd operand.
> ** For '(a .. b .. c)' (which is '(a .. (b .. c))', because
> ** concatenation is right associative), merge second CONCAT into first
> ** one.
> */

889c1124
<       lua_assert(e1->t == NO_JUMP);  /* list must be closed */
>       lua_assert(e1->t == NO_JUMP);  /* list closed by 'luK_infix' */

896c1131
<       lua_assert(e1->f == NO_JUMP);  /* list must be closed */
>       lua_assert(e1->f == NO_JUMP);  /* list closed by 'luK_infix' */

904,905c1139,1141
<       if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) {
<         lua_assert(e1->u.info == GETARG_B(getcode(fs, e2))-1);
>       if (e2->k == VRELOCABLE &&
>           GET_OPCODE(getinstruction(fs, e2)) == OP_CONCAT) {
>         lua_assert(e1->u.info == GETARG_B(getinstruction(fs, e2))-1);

907c1143
<         SETARG_B(getcode(fs, e2), e1->u.info);
>         SETARG_B(getinstruction(fs, e2), e1->u.info);

912c1148
<         codeexpval(fs, OP_CONCAT, e1, e2, line);
>         codebinexpval(fs, OP_CONCAT, e1, e2, line);

920,924c1156,1157
<       codeexpval(fs, cast(OpCode, (op - OPR_ADD) + OP_ADD), e1, e2, line);
<       break;
<     }
<     case OPR_EQ: case OPR_LT: case OPR_LE: {
<       codecomp(fs, cast(OpCode, (op - OPR_EQ) + OP_EQ), 1, e1, e2);
>       if (!constfolding(fs, op + LUA_OPADD, e1, e2))
>         codebinexpval(fs, cast(OpCode, op + OP_ADD), e1, e2, line);

926a1160
>     case OPR_EQ: case OPR_LT: case OPR_LE:

928c1162
<       codecomp(fs, cast(OpCode, (op - OPR_NE) + OP_EQ), 0, e1, e2);
>       codecomp(fs, op, e1, e2);

935a1170,1172
> /*
> ** Change line information associated with current position.
> */

940a1178,1184
> /*
> ** Emit a SETLIST instruction.
> ** 'base' is register that keeps table;
> ** 'nelems' is #table plus those to be stored now;
> ** 'tostore' is number of values (in registers 'base + 1',...) to add to
> ** table (or LUA_MULTRET to add up to stack top).
> */

944c1188
<   lua_assert(tostore != 0);
>   lua_assert(tostore != 0 && tostore <= LFIELDS_PER_FLUSH);

src/lcode.h

2c2
< ** $Id: lcode.h,v 1.63 2013/12/30 20:47:58 roberto Exp $
> ** $Id: lcode.h,v 1.64 2016/01/05 16:22:37 roberto Exp $

43c43,44
< #define getcode(fs,e)	((fs)->f->code[(e)->u.info])
> /* get (pointer to) instruction of given 'expdesc' */
> #define getinstruction(fs,e)	((fs)->f->code[(e)->u.info])

src/lcorolib.c

2c2
< ** $Id: lcorolib.c,v 1.9 2014/11/02 19:19:04 roberto Exp $
> ** $Id: lcorolib.c,v 1.10 2016/04/11 19:19:55 roberto Exp $

78c78
<     if (lua_isstring(L, -1)) {  /* error object is a string? */
>     if (lua_type(L, -1) == LUA_TSTRING) {  /* error object is a string? */

src/ldebug.c

2c2
< ** $Id: ldebug.c,v 2.117 2015/11/02 18:48:07 roberto Exp $
> ** $Id: ldebug.c,v 2.120 2016/03/31 19:01:21 roberto Exp $

72c72,78
< ** this function can be called asynchronous (e.g. during a signal)
> ** This function can be called asynchronously (e.g. during a signal).
> ** Fields 'oldpc', 'basehookcount', and 'hookcount' (set by
> ** 'resethookcount') are for debug only, and it is no problem if they
> ** get arbitrary values (causes at most one wrong hook call). 'hookmask'
> ** is an atomic value. We assume that pointers are atomic too (e.g., gcc
> ** ensures that for all platforms where it runs). Moreover, 'hook' is
> ** always checked before being called (see 'luaD_hook').

561c567
<   const char *t = objtypename(o);
>   const char *t = luaT_objtypename(L, o);

593,595c599,601
<   const char *t1 = objtypename(p1);
<   const char *t2 = objtypename(p2);
<   if (t1 == t2)
>   const char *t1 = luaT_objtypename(L, p1);
>   const char *t2 = luaT_objtypename(L, p2);
>   if (strcmp(t1, t2) == 0)

src/ldo.c

2c2
< ** $Id: ldo.c,v 2.150 2015/11/19 19:16:22 roberto Exp $
> ** $Id: ldo.c,v 2.151 2015/12/16 16:40:07 roberto Exp $

244a245,249
> /*
> ** Call a hook for the given event. Make sure there is a hook to be
> ** called. (Both 'L->hook' and 'L->hookmask', which triggers this
> ** function, can be changed asynchronously by signals.)
> */

247c252
<   if (hook && L->allowhook) {
>   if (hook && L->allowhook) {  /* make sure there is a hook */

src/ldo.h

2c2
< ** $Id: ldo.h,v 2.28 2015/11/23 11:29:43 roberto Exp $
> ** $Id: ldo.h,v 2.29 2015/12/21 13:02:14 roberto Exp $

28c28
< #define luaD_checkstack(L,n)	luaD_checkstackaux(L,n,,)
> #define luaD_checkstack(L,n)	luaD_checkstackaux(L,n,(void)0,(void)0)

src/lgc.c

2c2
< ** $Id: lgc.c,v 2.210 2015/11/03 18:10:44 roberto Exp $
> ** $Id: lgc.c,v 2.212 2016/03/31 19:02:03 roberto Exp $

757c757
< static GCObject **sweeptolive (lua_State *L, GCObject **p, int *n) {
> static GCObject **sweeptolive (lua_State *L, GCObject **p) {

759d758
<   int i = 0;

761d759
<     i++;

764d761
<   if (n) *n += i;

859c856
< static void callallpendingfinalizers (lua_State *L, int propagateerrors) {
> static void callallpendingfinalizers (lua_State *L) {

862c859
<     GCTM(L, propagateerrors);
>     GCTM(L, 0);

912c909
<         g->sweepgc = sweeptolive(L, g->sweepgc, NULL);  /* change 'sweepgc' */
>         g->sweepgc = sweeptolive(L, g->sweepgc);  /* change 'sweepgc' */

954,958c951,954
< ** The call to 'sweeptolive' makes pointer point to an object inside
< ** the list (instead of to the header), so that the real sweep do not
< ** need to skip objects created between "now" and the start of the real
< ** sweep.
< ** Returns how many objects it swept.
> ** The call to 'sweeplist' tries to make pointer point to an object
> ** inside the list (instead of to the header), so that the real sweep do
> ** not need to skip objects created between "now" and the start of the
> ** real sweep.

960c956
< static int entersweep (lua_State *L) {
> static void entersweep (lua_State *L) {

962d957
<   int n = 0;

965,966c960
<   g->sweepgc = sweeptolive(L, &g->allgc, &n);
<   return n;
>   g->sweepgc = sweeplist(L, &g->allgc, 1);

974c968
<   callallpendingfinalizers(L, 0);
>   callallpendingfinalizers(L);

1067d1060
<       int sw;

1070c1063
<       sw = entersweep(L);
>       entersweep(L);

1072c1065
<       return work + sw * GCSWEEPCOST;
>       return work;

src/lgc.h

2c2
< ** $Id: lgc.h,v 2.90 2015/10/21 18:15:15 roberto Exp $
> ** $Id: lgc.h,v 2.91 2015/12/21 13:02:14 roberto Exp $

115c115
< #define luaC_checkGC(L)		luaC_condGC(L,,)
> #define luaC_checkGC(L)		luaC_condGC(L,(void)0,(void)0)

src/liolib.c

2c2
< ** $Id: liolib.c,v 2.148 2015/11/23 11:36:11 roberto Exp $
> ** $Id: liolib.c,v 2.149 2016/05/02 14:03:19 roberto Exp $

378c378,381
< #define MAXRN		200
> #if !defined (L_MAXLENNUM)
> #define L_MAXLENNUM     200
> #endif
> 

385c388
<   char buff[MAXRN + 1];  /* +1 for ending '\0' */
>   char buff[L_MAXLENNUM + 1];  /* +1 for ending '\0' */

393c396
<   if (rn->n >= MAXRN) {  /* buffer overflow? */
>   if (rn->n >= L_MAXLENNUM) {  /* buffer overflow? */

406c409
< ** Accept current char if it is in 'set' (of size 1 or 2)
> ** Accept current char if it is in 'set' (of size 2)

409c412
<   if (rn->c == set[0] || (rn->c == set[1] && rn->c != '\0'))
>   if (rn->c == set[0] || rn->c == set[1])

438c441
<   decp[1] = '\0';
>   decp[1] = '.';  /* always accept a dot */

442c445
<   if (test2(&rn, "0")) {
>   if (test2(&rn, "00")) {

src/llex.c

2c2
< ** $Id: llex.c,v 2.95 2015/11/19 19:16:22 roberto Exp $
> ** $Id: llex.c,v 2.96 2016/05/02 14:02:12 roberto Exp $

165d164
<   ls->decpoint = '.';

210,238d208
< /*
< ** change all characters 'from' in buffer to 'to'
< */
< static void buffreplace (LexState *ls, char from, char to) {
<   if (from != to) {
<     size_t n = luaZ_bufflen(ls->buff);
<     char *p = luaZ_buffer(ls->buff);
<     while (n--)
<       if (p[n] == from) p[n] = to;
<   }
< }
< 
< 
< /*
< ** in case of format error, try to change decimal point separator to
< ** the one defined in the current locale and check again
< */
< static void trydecpoint (LexState *ls, TValue *o) {
<   char old = ls->decpoint;
<   ls->decpoint = lua_getlocaledecpoint();
<   buffreplace(ls, old, ls->decpoint);  /* try new decimal separator */
<   if (luaO_str2num(luaZ_buffer(ls->buff), o) == 0) {
<     /* format error with correct decimal point: no more options */
<     buffreplace(ls, ls->decpoint, '.');  /* undo change (for error message) */
<     lexerror(ls, "malformed number", TK_FLT);
<   }
< }
< 
< 

262d231
<   buffreplace(ls, '.', ls->decpoint);  /* follow locale for decimal point */

264c233
<     trydecpoint(ls, &obj); /* try to update decimal point separator */
>     lexerror(ls, "malformed number", TK_FLT);

src/llex.h

2c2
< ** $Id: llex.h,v 1.78 2014/10/29 15:38:24 roberto Exp $
> ** $Id: llex.h,v 1.79 2016/05/02 14:02:12 roberto Exp $

72d71
<   char decpoint;  /* locale decimal point */

src/lobject.c

2c2
< ** $Id: lobject.c,v 2.108 2015/11/02 16:09:30 roberto Exp $
> ** $Id: lobject.c,v 2.111 2016/05/20 14:07:48 roberto Exp $

246c246,251
< static const char *l_str2d (const char *s, lua_Number *result) {
> /* maximum length of a numeral */
> #if !defined (L_MAXLENNUM)
> #define L_MAXLENNUM	200
> #endif
> 
> static const char *l_str2dloc (const char *s, lua_Number *result, int mode) {

248c253,278
<   if (strpbrk(s, "nN"))  /* reject 'inf' and 'nan' */
>   *result = (mode == 'x') ? lua_strx2number(s, &endptr)  /* try to convert */
>                           : lua_str2number(s, &endptr);
>   if (endptr == s) return NULL;  /* nothing recognized? */
>   while (lisspace(cast_uchar(*endptr))) endptr++;  /* skip trailing spaces */
>   return (*endptr == '\0') ? endptr : NULL;  /* OK if no trailing characters */
> }
> 
> 
> /*
> ** Convert string 's' to a Lua number (put in 'result'). Return NULL
> ** on fail or the address of the ending '\0' on success.
> ** 'pmode' points to (and 'mode' contains) special things in the string:
> ** - 'x'/'X' means an hexadecimal numeral
> ** - 'n'/'N' means 'inf' or 'nan' (which should be rejected)
> ** - '.' just optimizes the search for the common case (nothing special)
> ** This function accepts both the current locale or a dot as the radix
> ** mark. If the convertion fails, it may mean number has a dot but
> ** locale accepts something else. In that case, the code copies 's'
> ** to a buffer (because 's' is read-only), changes the dot to the
> ** current locale radix mark, and tries to convert again.
> */
> static const char *l_str2d (const char *s, lua_Number *result) {
>   const char *endptr;
>   const char *pmode = strpbrk(s, ".xXnN");
>   int mode = pmode ? ltolower(cast_uchar(*pmode)) : 0;
>   if (mode == 'n')  /* reject 'inf' and 'nan' */

250,256c280,292
<   else if (strpbrk(s, "xX"))  /* hex? */
<     *result = lua_strx2number(s, &endptr);
<   else
<     *result = lua_str2number(s, &endptr);
<   if (endptr == s) return NULL;  /* nothing recognized */
<   while (lisspace(cast_uchar(*endptr))) endptr++;
<   return (*endptr == '\0' ? endptr : NULL);  /* OK if no trailing characters */
>   endptr = l_str2dloc(s, result, mode);  /* try to convert */
>   if (endptr == NULL) {  /* failed? may be a different locale */
>     char buff[L_MAXLENNUM + 1];
>     char *pdot = strchr(s, '.');
>     if (strlen(s) > L_MAXLENNUM || pdot == NULL)
>       return NULL;  /* string too long or no dot; fail */
>     strcpy(buff, s);  /* copy string to buffer */
>     buff[pdot - s] = lua_getlocaledecpoint();  /* correct decimal point */
>     endptr = l_str2dloc(buff, result, mode);  /* try again */
>     if (endptr != NULL)
>       endptr = s + (endptr - buff);  /* make relative to 's' */
>   }
>   return endptr;

259a296,298
> #define MAXBY10		cast(lua_Unsigned, LUA_MAXINTEGER / 10)
> #define MAXLASTD	cast_int(LUA_MAXINTEGER % 10)
> 

276c315,318
<       a = a * 10 + *s - '0';
>       int d = *s - '0';
>       if (a >= MAXBY10 && (a > MAXBY10 || d > MAXLASTD + neg))  /* overflow? */
>         return NULL;  /* do not accept it (as integer) */
>       a = a * 10 + d;

354,355c396,399
< /* this function handles only '%d', '%c', '%f', '%p', and '%s' 
<    conventional formats, plus Lua-specific '%I' and '%U' */
> /*
> ** this function handles only '%d', '%c', '%f', '%p', and '%s' 
>    conventional formats, plus Lua-specific '%I' and '%U'
> */

363c407
<       case 's': {
>       case 's': {  /* zero-terminated string */

369c413
<       case 'c': {
>       case 'c': {  /* an 'int' as a character */

377c421
<       case 'd': {
>       case 'd': {  /* an 'int' */

381c425
<       case 'I': {
>       case 'I': {  /* a 'lua_Integer' */

385c429
<       case 'f': {
>       case 'f': {  /* a 'lua_Number' */

387c431
<       top2str:
>       top2str:  /* convert the top element to a string */

392c436
<       case 'p': {
>       case 'p': {  /* a pointer */

398c442
<       case 'U': {
>       case 'U': {  /* an 'int' as a UTF-8 sequence */

src/loslib.c

2c2
< ** $Id: loslib.c,v 1.60 2015/11/19 19:16:22 roberto Exp $
> ** $Id: loslib.c,v 1.64 2016/04/18 13:06:55 roberto Exp $

27c27,28
< ** list of valid conversion specifiers for the 'strftime' function
> ** List of valid conversion specifiers for the 'strftime' function;
> ** options are grouped by length; group of length 2 start with '||'.

32,33c33,47
< #if defined(LUA_USE_C89)
< #define LUA_STRFTIMEOPTIONS	{ "aAbBcdHIjmMpSUwWxXyYz%", "" }
> /* options for ANSI C 89 */
> #define L_STRFTIMEC89		"aAbBcdHIjmMpSUwWxXyYZ%"
> 
> /* options for ISO C 99 and POSIX */
> #define L_STRFTIMEC99 "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%" \
> 	"||" "EcECExEXEyEY" "OdOeOHOIOmOMOSOuOUOVOwOWOy"
> 
> /* options for Windows */
> #define L_STRFTIMEWIN "aAbBcdHIjmMpSUwWxXyYzZ%" \
> 	"||" "#c#x#d#H#I#j#m#M#S#U#w#W#y#Y"
> 
> #if defined(LUA_USE_WINDOWS)
> #define LUA_STRFTIMEOPTIONS	L_STRFTIMEWIN
> #elif defined(LUA_USE_C89)
> #define LUA_STRFTIMEOPTIONS	L_STRFTIMEC89

35,38c49
< #define LUA_STRFTIMEOPTIONS \
< 	{ "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%", "", \
< 	  "E", "cCxXyY",  \
< 	  "O", "deHImMSuUVwWy" }
> #define LUA_STRFTIMEOPTIONS	L_STRFTIMEC99

197a209,225
> 
> /*
> ** Set all fields from structure 'tm' in the table on top of the stack
> */
> static void setallfields (lua_State *L, struct tm *stm) {
>   setfield(L, "sec", stm->tm_sec);
>   setfield(L, "min", stm->tm_min);
>   setfield(L, "hour", stm->tm_hour);
>   setfield(L, "day", stm->tm_mday);
>   setfield(L, "month", stm->tm_mon + 1);
>   setfield(L, "year", stm->tm_year + 1900);
>   setfield(L, "wday", stm->tm_wday + 1);
>   setfield(L, "yday", stm->tm_yday + 1);
>   setboolfield(L, "isdst", stm->tm_isdst);
> }
> 
> 

213c241
<   int t = lua_getfield(L, -1, key);
>   int t = lua_getfield(L, -1, key);  /* get field and its type */

215c243
<   if (!isnum) {  /* field is not a number? */
>   if (!isnum) {  /* field is not an integer? */

217c245
<       return luaL_error(L, "field '%s' not an integer", key);
>       return luaL_error(L, "field '%s' is not an integer", key);

224c252
<       return luaL_error(L, "field '%s' out-of-bounds", key);
>       return luaL_error(L, "field '%s' is out-of-bound", key);

233,247c261,269
<   static const char *const options[] = LUA_STRFTIMEOPTIONS;
<   unsigned int i;
<   for (i = 0; i < sizeof(options)/sizeof(options[0]); i += 2) {
<     if (*conv != '\0' && strchr(options[i], *conv) != NULL) {
<       buff[1] = *conv;
<       if (*options[i + 1] == '\0') {  /* one-char conversion specifier? */
<         buff[2] = '\0';  /* end buffer */
<         return conv + 1;
<       }
<       else if (*(conv + 1) != '\0' &&
<                strchr(options[i + 1], *(conv + 1)) != NULL) {
<         buff[2] = *(conv + 1);  /* valid two-char conversion specifier */
<         buff[3] = '\0';  /* end buffer */
<         return conv + 2;
<       }
>   const char *option;
>   int oplen = 1;
>   for (option = LUA_STRFTIMEOPTIONS; *option != '\0'; option += oplen) {
>     if (*option == '|')  /* next block? */
>       oplen++;  /* next length */
>     else if (memcmp(conv, option, oplen) == 0) {  /* match? */
>       memcpy(buff, conv, oplen);  /* copy valid option to buffer */
>       buff[oplen] = '\0';
>       return conv + oplen;  /* return next item */

274,282c296
<     setfield(L, "sec", stm->tm_sec);
<     setfield(L, "min", stm->tm_min);
<     setfield(L, "hour", stm->tm_hour);
<     setfield(L, "day", stm->tm_mday);
<     setfield(L, "month", stm->tm_mon+1);
<     setfield(L, "year", stm->tm_year+1900);
<     setfield(L, "wday", stm->tm_wday+1);
<     setfield(L, "yday", stm->tm_yday+1);
<     setboolfield(L, "isdst", stm->tm_isdst);
>     setallfields(L, stm);

285c299
<     char cc[4];
>     char cc[4];  /* buffer for individual conversion specifiers */

295c309
<         s = checkoption(L, s + 1, cc);
>         s = checkoption(L, s + 1, cc + 1);  /* copy specifier to 'cc' */

321a336
>     setallfields(L, &ts);  /* update fields with normalized values */

src/lparser.c

2c2
< ** $Id: lparser.c,v 2.149 2015/11/02 16:09:30 roberto Exp $
> ** $Id: lparser.c,v 2.153 2016/05/13 19:10:16 roberto Exp $

167c167,168
<   while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL;
>   while (oldsize < f->sizelocvars)
>     f->locvars[oldsize++].varname = NULL;

233c234,235
<   while (oldsize < f->sizeupvalues) f->upvalues[oldsize++].name = NULL;
>   while (oldsize < f->sizeupvalues)
>     f->upvalues[oldsize++].name = NULL;

258c260,261
<   while (bl->nactvar > level) bl = bl->previous;
>   while (bl->nactvar > level)
>     bl = bl->previous;

267c270
< static int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) {
> static void singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) {

269c272
<     return VVOID;  /* default is global */
>     init_exp(var, VVOID, 0);  /* default is global */

276d278
<       return VLOCAL;

281,282c283,285
<         if (singlevaraux(fs->prev, n, var, 0) == VVOID) /* try upper levels */
<           return VVOID;  /* not found; is a global */
>         singlevaraux(fs->prev, n, var, 0);  /* try upper levels */
>         if (var->k == VVOID)  /* not found? */
>           return;  /* it is a global */

286,287c289
<       init_exp(var, VUPVAL, idx);
<       return VUPVAL;
>       init_exp(var, VUPVAL, idx);  /* new or old upvalue */

296c298,299
<   if (singlevaraux(fs, varname, var, 1) == VVOID) {  /* global name? */
>   singlevaraux(fs, varname, var, 1);
>   if (var->k == VVOID) {  /* global name? */

299c302
<     lua_assert(var->k == VLOCAL || var->k == VUPVAL);
>     lua_assert(var->k != VVOID);  /* this one must exist */

502c505,506
<     while (oldsize < f->sizep) f->p[oldsize++] = NULL;
>     while (oldsize < f->sizep)
>       f->p[oldsize++] = NULL;

1229c1233
<   l = newlabelentry(ls, ll, label, line, fs->pc);
>   l = newlabelentry(ls, ll, label, line, luaK_getlabel(fs));

1497c1501
<     SETARG_C(getcode(fs, &v.v), 1);  /* call statement uses no results */
>     SETARG_C(getinstruction(fs, &v.v), 1);  /* call statement uses no results */

1514,1515c1518,1519
<         SET_OPCODE(getcode(fs,&e), OP_TAILCALL);
<         lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar);
>         SET_OPCODE(getinstruction(fs,&e), OP_TAILCALL);
>         lua_assert(GETARG_A(getinstruction(fs,&e)) == fs->nactvar);

src/lparser.h

2c2
< ** $Id: lparser.h,v 1.74 2014/10/25 11:50:46 roberto Exp $
> ** $Id: lparser.h,v 1.76 2015/12/30 18:16:13 roberto Exp $

16c16,21
< ** Expression descriptor
> ** Expression and variable descriptor.
> ** Code generation for variables and expressions can be delayed to allow
> ** optimizations; An 'expdesc' structure describes a potentially-delayed
> ** variable/expression. It has a description of its "main" value plus a
> ** list of conditional jumps that can also produce its value (generated
> ** by short-circuit operators 'and'/'or').

18a24
> /* kinds of variables/expressions */

20,34c26,47
<   VVOID,	/* no value */
<   VNIL,
<   VTRUE,
<   VFALSE,
<   VK,		/* info = index of constant in 'k' */
<   VKFLT,	/* nval = numerical float value */
<   VKINT,	/* nval = numerical integer value */
<   VNONRELOC,	/* info = result register */
<   VLOCAL,	/* info = local register */
<   VUPVAL,       /* info = index of upvalue in 'upvalues' */
<   VINDEXED,	/* t = table register/upvalue; idx = index R/K */
<   VJMP,		/* info = instruction pc */
<   VRELOCABLE,	/* info = instruction pc */
<   VCALL,	/* info = instruction pc */
<   VVARARG	/* info = instruction pc */
>   VVOID,  /* when 'expdesc' describes the last expression a list,
>              this kind means an empty list (so, no expression) */
>   VNIL,  /* constant nil */
>   VTRUE,  /* constant true */
>   VFALSE,  /* constant false */
>   VK,  /* constant in 'k'; info = index of constant in 'k' */
>   VKFLT,  /* floating constant; nval = numerical float value */
>   VKINT,  /* integer constant; nval = numerical integer value */
>   VNONRELOC,  /* expression has its value in a fixed register;
>                  info = result register */
>   VLOCAL,  /* local variable; info = local register */
>   VUPVAL,  /* upvalue variable; info = index of upvalue in 'upvalues' */
>   VINDEXED,  /* indexed variable;
>                 ind.vt = whether 't' is register or upvalue;
>                 ind.t = table register or upvalue;
>                 ind.idx = key's R/K index */
>   VJMP,  /* expression is a test/comparison;
>             info = pc of corresponding jump instruction */
>   VRELOCABLE,  /* expression can put result in any register;
>                   info = instruction pc */
>   VCALL,  /* expression is a function call; info = instruction pc */
>   VVARARG  /* vararg expression; info = instruction pc */

43a57,59
>     lua_Integer ival;    /* for VKINT */
>     lua_Number nval;  /* for VKFLT */
>     int info;  /* for generic use */

49,51d64
<     int info;  /* for generic use */
<     lua_Number nval;  /* for VKFLT */
<     lua_Integer ival;    /* for VKINT */

src/lstate.h

2c2
< ** $Id: lstate.h,v 2.128 2015/11/13 12:16:51 roberto Exp $
> ** $Id: lstate.h,v 2.130 2015/12/16 16:39:38 roberto Exp $

35a36,44
> /*
> ** Atomic type (relative to signals) to better ensure that 'lua_sethook' 
> ** is thread safe
> */
> #if !defined(l_signalT)
> #include <signal.h>
> #define l_signalT	sig_atomic_t
> #endif
> 

165c174
<   lua_Hook hook;
>   volatile lua_Hook hook;

172c181
<   lu_byte hookmask;
>   l_signalT hookmask;

src/lstrlib.c

2c2
< ** $Id: lstrlib.c,v 1.239 2015/11/25 16:28:17 roberto Exp $
> ** $Id: lstrlib.c,v 1.251 2016/05/20 14:13:21 roberto Exp $

15a16
> #include <locale.h>

29c30,31
< ** pattern-matching. This limit is arbitrary.
> ** pattern-matching. This limit is arbitrary, but must fit in
> ** an unsigned char.

217d218
<   size_t nrep;  /* limit to avoid non-linear complexity */

219c220
<   int level;  /* total number of captures (finished or unfinished) */
>   unsigned char level;  /* total number of captures (finished or unfinished) */

237,247d237
< /*
< ** parameters to control the maximum number of operators handled in
< ** a match (to avoid non-linear complexity). The maximum will be:
< ** (subject length) * A_REPS + B_REPS
< */
< #if !defined(A_REPS)
< #define A_REPS		4
< #define B_REPS		100000
< #endif
< 
< 

505,506d494
<           if (ms->nrep-- == 0)
<             luaL_error(ms->L, "pattern too complex");

610,613d597
<   if (ls < (MAX_SIZET - B_REPS) / A_REPS)
<     ms->nrep = A_REPS * ls + B_REPS;
<   else  /* overflow (very long subject) */
<     ms->nrep = MAX_SIZET;  /* no limit */

683a668
>   const char *lastmatch;  /* end of last match */

690a676
>   gm->ms.L = L;

694,698c680,681
<     if ((e = match(&gm->ms, src, gm->p)) != NULL) {
<       if (e == src)  /* empty match? */
<         gm->src =src + 1;  /* go at least one position */
<       else
<         gm->src = e;
>     if ((e = match(&gm->ms, src, gm->p)) != NULL && e != gm->lastmatch) {
>       gm->src = gm->lastmatch = e;

714c697
<   gm->src = s; gm->p = p;
>   gm->src = s; gm->p = p; gm->lastmatch = NULL;

781,784c764,768
<   const char *src = luaL_checklstring(L, 1, &srcl);
<   const char *p = luaL_checklstring(L, 2, &lp);
<   int tr = lua_type(L, 3);
<   lua_Integer max_s = luaL_optinteger(L, 4, srcl + 1);
>   const char *src = luaL_checklstring(L, 1, &srcl);  /* subject */
>   const char *p = luaL_checklstring(L, 2, &lp);  /* pattern */
>   const char *lastmatch = NULL;  /* end of last match */
>   int tr = lua_type(L, 3);  /* replacement type */
>   lua_Integer max_s = luaL_optinteger(L, 4, srcl + 1);  /* max replacements */

786c770
<   lua_Integer n = 0;
>   lua_Integer n = 0;  /* replacement count */

799,800c783,784
<     reprepstate(&ms);
<     if ((e = match(&ms, src, p)) != NULL) {
>     reprepstate(&ms);  /* (re)prepare state for new match */
>     if ((e = match(&ms, src, p)) != NULL && e != lastmatch) {  /* match? */

802c786,787
<       add_value(&ms, &b, src, e, tr);
>       add_value(&ms, &b, src, e, tr);  /* add replacement to buffer */
>       src = lastmatch = e;

804,806c789
<     if (e && e>src) /* non empty match? */
<       src = e;  /* skip it */
<     else if (src < ms.src_end)
>     else if (src < ms.src_end)  /* otherwise, skip one character */

808c791
<     else break;
>     else break;  /* end of subject */

833d815
< #include <locale.h>

925,927c907
< static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
<   size_t l;
<   const char *s = luaL_checklstring(L, arg, &l);
> static void addquoted (luaL_Buffer *b, const char *s, size_t len) {

929c909
<   while (l--) {
>   while (len--) {

934c914
<     else if (*s == '\0' || iscntrl(uchar(*s))) {
>     else if (iscntrl(uchar(*s))) {

948a929,979
> 
> /*
> ** Ensures the 'buff' string uses a dot as the radix character.
> */
> static void checkdp (char *buff, int nb) {
>   if (memchr(buff, '.', nb) == NULL) {  /* no dot? */
>     char point = lua_getlocaledecpoint();  /* try locale point */
>     char *ppoint = memchr(buff, point, nb);
>     if (ppoint) *ppoint = '.';  /* change it to a dot */
>   }
> }
> 
> 
> static void addliteral (lua_State *L, luaL_Buffer *b, int arg) {
>   switch (lua_type(L, arg)) {
>     case LUA_TSTRING: {
>       size_t len;
>       const char *s = lua_tolstring(L, arg, &len);
>       addquoted(b, s, len);
>       break;
>     }
>     case LUA_TNUMBER: {
>       char *buff = luaL_prepbuffsize(b, MAX_ITEM);
>       int nb;
>       if (!lua_isinteger(L, arg)) {  /* float? */
>         lua_Number n = lua_tonumber(L, arg);  /* write as hexa ('%a') */
>         nb = lua_number2strx(L, buff, MAX_ITEM, "%" LUA_NUMBER_FRMLEN "a", n);
>         checkdp(buff, nb);  /* ensure it uses a dot */
>       }
>       else {  /* integers */
>         lua_Integer n = lua_tointeger(L, arg);
>         const char *format = (n == LUA_MININTEGER)  /* corner case? */
>                            ? "0x%" LUA_INTEGER_FRMLEN "x"  /* use hexa */
>                            : LUA_INTEGER_FMT;  /* else use default format */
>         nb = l_sprintf(buff, MAX_ITEM, format, n);
>       }
>       luaL_addsize(b, nb);
>       break;
>     }
>     case LUA_TNIL: case LUA_TBOOLEAN: {
>       luaL_tolstring(L, arg, NULL);
>       luaL_addvalue(b);
>       break;
>     }
>     default: {
>       luaL_argerror(L, arg, "value has no literal form");
>     }
>   }
> }
> 
> 

1028c1059
<           addquoted(L, &b, arg);
>           addliteral(L, &b, arg);

1073,1074c1104,1105
< #if !defined(LUA_PACKPADBYTE)
< #define LUA_PACKPADBYTE		0x00
> #if !defined(LUAL_PACKPADBYTE)
> #define LUAL_PACKPADBYTE		0x00

1311c1342
<      luaL_addchar(&b, LUA_PACKPADBYTE);  /* fill alignment */
>      luaL_addchar(&b, LUAL_PACKPADBYTE);  /* fill alignment */

1346,1352c1377,1381
<         if ((size_t)size <= len)  /* string larger than (or equal to) needed? */
<           luaL_addlstring(&b, s, size);  /* truncate string to asked size */
<         else {  /* string smaller than needed */
<           luaL_addlstring(&b, s, len);  /* add it all */
<           while (len++ < (size_t)size)  /* pad extra space */
<             luaL_addchar(&b, LUA_PACKPADBYTE);
<         }
>         luaL_argcheck(L, len <= (size_t)size, arg,
>                          "string longer than given size");
>         luaL_addlstring(&b, s, len);  /* add string */
>         while (len++ < (size_t)size)  /* pad extra space */
>           luaL_addchar(&b, LUAL_PACKPADBYTE);

1375c1404
<       case Kpadding: luaL_addchar(&b, LUA_PACKPADBYTE);  /* FALLTHROUGH */
>       case Kpadding: luaL_addchar(&b, LUAL_PACKPADBYTE);  /* FALLTHROUGH */

src/ltablib.c

2c2
< ** $Id: ltablib.c,v 1.90 2015/11/25 12:48:57 roberto Exp $
> ** $Id: ltablib.c,v 1.93 2016/02/25 19:41:54 roberto Exp $

56c56
<       luaL_argerror(L, arg, "table expected");  /* force an error */
>       luaL_checktype(L, arg, LUA_TTABLE);  /* force an error */

142c142
<     if (t > e || t <= f || tt != 1) {
>     if (t > e || t <= f || (tt != 1 && !lua_compare(L, 1, tt, LUA_OPEQ))) {

155c155
<   lua_pushvalue(L, tt);  /* return "to table" */
>   lua_pushvalue(L, tt);  /* return destination table */

175c175
<   last = luaL_opt(L, luaL_checkinteger, 4, last);
>   last = luaL_optinteger(L, 4, last);

234a235,238
> /* type for array indices */
> typedef unsigned int IdxT;
> 
> 

273c277
< static void set2 (lua_State *L, unsigned int i, unsigned int j) {
> static void set2 (lua_State *L, IdxT i, IdxT j) {

306,309c310,312
< static unsigned int partition (lua_State *L, unsigned int lo,
<                                              unsigned int up) {
<   unsigned int i = lo;  /* will be incremented before first use */
<   unsigned int j = up - 1;  /* will be decremented before first use */
> static IdxT partition (lua_State *L, IdxT lo, IdxT up) {
>   IdxT i = lo;  /* will be incremented before first use */
>   IdxT j = up - 1;  /* will be decremented before first use */

343,346c346,348
< static unsigned int choosePivot (unsigned int lo, unsigned int up,
<                                  unsigned int rnd) {
<   unsigned int r4 = (unsigned int)(up - lo) / 4u;  /* range/4 */
<   unsigned int p = rnd % (r4 * 2) + (lo + r4);
> static IdxT choosePivot (IdxT lo, IdxT up, unsigned int rnd) {
>   IdxT r4 = (up - lo) / 4;  /* range/4 */
>   IdxT p = rnd % (r4 * 2) + (lo + r4);

355c357
< static void auxsort (lua_State *L, unsigned int lo, unsigned int up,
> static void auxsort (lua_State *L, IdxT lo, IdxT up,

358,359c360,361
<     unsigned int p;  /* Pivot index */
<     unsigned int n;  /* to be used later */
>     IdxT p;  /* Pivot index */
>     IdxT n;  /* to be used later */

403c405
<     if ((up - lo) / 128u > n) /* partition too imbalanced? */
>     if ((up - lo) / 128 > n) /* partition too imbalanced? */

413d414
<     luaL_checkstack(L, 40, "");  /* assume array is smaller than 2^40 */

417c418
<     auxsort(L, 1, (unsigned int)n, 0u);
>     auxsort(L, 1, (IdxT)n, 0);

src/ltm.c

2c2
< ** $Id: ltm.c,v 2.36 2015/11/03 15:47:30 roberto Exp $
> ** $Id: ltm.c,v 2.37 2016/02/26 19:20:15 roberto Exp $

85a86,101
> /*
> ** Return the name of the type of an object. For tables and userdata
> ** with metatable, use their '__name' metafield, if present.
> */
> const char *luaT_objtypename (lua_State *L, const TValue *o) {
>   Table *mt;
>   if ((ttistable(o) && (mt = hvalue(o)->metatable) != NULL) ||
>       (ttisfulluserdata(o) && (mt = uvalue(o)->metatable) != NULL)) {
>     const TValue *name = luaH_getshortstr(mt, luaS_new(L, "__name"));
>     if (ttisstring(name))  /* is '__name' a string? */
>       return getstr(tsvalue(name));  /* use it as type name */
>   }
>   return ttypename(ttnov(o));  /* else use standard type name */
> }
> 
> 

src/ltm.h

2c2
< ** $Id: ltm.h,v 2.21 2014/10/25 11:50:46 roberto Exp $
> ** $Id: ltm.h,v 2.22 2016/02/26 19:20:15 roberto Exp $

54d53
< #define objtypename(x)	ttypename(ttnov(x))

58a58,59
> LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o);
> 

src/lua.h

2c2
< ** $Id: lua.h,v 1.329 2015/11/13 17:18:42 roberto Exp $
> ** $Id: lua.h,v 1.331 2016/05/30 15:53:28 roberto Exp $

22c22
< #define LUA_VERSION_RELEASE	"2"
> #define LUA_VERSION_RELEASE	"3"

26c26
< #define LUA_COPYRIGHT	LUA_RELEASE "  Copyright (C) 1994-2015 Lua.org, PUC-Rio"
> #define LUA_COPYRIGHT	LUA_RELEASE "  Copyright (C) 1994-2016 Lua.org, PUC-Rio"

364c364
< 	lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS)
> 	((void)lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS))

463c463
< * Copyright (C) 1994-2015 Lua.org, PUC-Rio.
> * Copyright (C) 1994-2016 Lua.org, PUC-Rio.

src/luaconf.h

2c2
< ** $Id: luaconf.h,v 1.254 2015/10/21 18:17:40 roberto Exp $
> ** $Id: luaconf.h,v 1.255 2016/05/01 20:06:09 roberto Exp $

615c615
< #define lua_number2strx(L,b,sz,f,n)	l_sprintf(b,sz,f,n)
> #define lua_number2strx(L,b,sz,f,n)	((void)L, l_sprintf(b,sz,f,n))

src/lvm.c

2c2
< ** $Id: lvm.c,v 2.265 2015/11/23 11:30:45 roberto Exp $
> ** $Id: lvm.c,v 2.268 2016/02/05 19:59:14 roberto Exp $

156,157c156,158
< ** Complete a table access: if 't' is a table, 'tm' has its metamethod;
< ** otherwise, 'tm' is NULL.
> ** Finish the table access 'val = t[key]'.
> ** if 'slot' is NULL, 't' is not a table; otherwise, 'slot' points to
> ** t[k] entry (which must be nil).

160c161
<                       const TValue *tm) {
>                       const TValue *slot) {

162c163
<   lua_assert(tm != NULL || !ttistable(t));
>   const TValue *tm;  /* metamethod */

164,165c165,168
<     if (tm == NULL) {  /* no metamethod (from a table)? */
<       if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX)))
>     if (slot == NULL) {  /* 't' is not a table? */
>       lua_assert(!ttistable(t));
>       tm = luaT_gettmbyobj(L, t, TM_INDEX);
>       if (ttisnil(tm))

166a170
>       /* else will try the metamethod */

168c172,181
<     if (ttisfunction(tm)) {  /* metamethod is a function */
>     else {  /* 't' is a table */
>       lua_assert(ttisnil(slot));
>       tm = fasttm(L, hvalue(t)->metatable, TM_INDEX);  /* table's metamethod */
>       if (tm == NULL) {  /* no metamethod? */
>         setnilvalue(val);  /* result is nil */
>         return;
>       }
>       /* else will try the metamethod */
>     }
>     if (ttisfunction(tm)) {  /* is metamethod a function? */

172,174c185,187
<     t = tm;  /* else repeat access over 'tm' */
<     if (luaV_fastget(L,t,key,tm,luaH_get)) {  /* try fast track */
<       setobj2s(L, val, tm);  /* done */
>     t = tm;  /* else try to access 'tm[key]' */
>     if (luaV_fastget(L,t,key,slot,luaH_get)) {  /* fast track? */
>       setobj2s(L, val, slot);  /* done */

177c190
<     /* else repeat */
>     /* else repeat (tail call 'luaV_finishget') */

179c192
<   luaG_runerror(L, "gettable chain too long; possible loop");
>   luaG_runerror(L, "'__index' chain too long; possible loop");

184,185c197,201
< ** Main function for table assignment (invoking metamethods if needed).
< ** Compute 't[key] = val'
> ** Finish a table assignment 't[key] = val'.
> ** If 'slot' is NULL, 't' is not a table.  Otherwise, 'slot' points
> ** to the entry 't[key]', or to 'luaO_nilobject' if there is no such
> ** entry.  (The value at 'slot' must be nil, otherwise 'luaV_fastset'
> ** would have done the job.)

188c204
<                      StkId val, const TValue *oldval) {
>                      StkId val, const TValue *slot) {

191,200c207,214
<     const TValue *tm;
<     if (oldval != NULL) {
<       lua_assert(ttistable(t) && ttisnil(oldval));
<       /* must check the metamethod */
<       if ((tm = fasttm(L, hvalue(t)->metatable, TM_NEWINDEX)) == NULL &&
<          /* no metamethod; is there a previous entry in the table? */
<          (oldval != luaO_nilobject ||
<          /* no previous entry; must create one. (The next test is
<             always true; we only need the assignment.) */
<          (oldval = luaH_newkey(L, hvalue(t), key), 1))) {
>     const TValue *tm;  /* '__newindex' metamethod */
>     if (slot != NULL) {  /* is 't' a table? */
>       Table *h = hvalue(t);  /* save 't' table */
>       lua_assert(ttisnil(slot));  /* old value must be nil */
>       tm = fasttm(L, h->metatable, TM_NEWINDEX);  /* get metamethod */
>       if (tm == NULL) {  /* no metamethod? */
>         if (slot == luaO_nilobject)  /* no previous entry? */
>           slot = luaH_newkey(L, h, key);  /* create one */

202,204c216,218
<         setobj2t(L, cast(TValue *, oldval), val);
<         invalidateTMcache(hvalue(t));
<         luaC_barrierback(L, hvalue(t), val);
>         setobj2t(L, cast(TValue *, slot), val);  /* set its new value */
>         invalidateTMcache(h);
>         luaC_barrierback(L, h, val);

219c233
<     if (luaV_fastset(L, t, key, oldval, luaH_get, val))
>     if (luaV_fastset(L, t, key, slot, luaH_get, val))

223c237
<   luaG_runerror(L, "settable chain too long; possible loop");
>   luaG_runerror(L, "'__newindex' chain too long; possible loop");

740a755,764
> /* fetch an instruction and prepare its execution */
> #define vmfetch()	{ \
>   i = *(ci->u.l.savedpc++); \
>   if (L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) \
>     Protect(luaG_traceexec(L)); \
>   ra = RA(i); /* WARNING: any stack reallocation invalidates 'ra' */ \
>   lua_assert(base == ci->u.l.base); \
>   lua_assert(base <= L->top && L->top < L->stack + L->stacksize); \
> }
> 

747,748c771,772
< ** copy of 'luaV_gettable', but protecting call to potential metamethod
< ** (which can reallocate the stack)
> ** copy of 'luaV_gettable', but protecting the call to potential
> ** metamethod (which can reallocate the stack)

750,752c774,776
< #define gettableProtected(L,t,k,v)  { const TValue *aux; \
<   if (luaV_fastget(L,t,k,aux,luaH_get)) { setobj2s(L, v, aux); } \
<   else Protect(luaV_finishget(L,t,k,v,aux)); }
> #define gettableProtected(L,t,k,v)  { const TValue *slot; \
>   if (luaV_fastget(L,t,k,slot,luaH_get)) { setobj2s(L, v, slot); } \
>   else Protect(luaV_finishget(L,t,k,v,slot)); }

775c799
<     Instruction i = *(ci->u.l.savedpc++);
>     Instruction i;

777,782c801
<     if (L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT))
<       Protect(luaG_traceexec(L));
<     /* WARNING: several calls may realloc the stack and invalidate 'ra' */
<     ra = RA(i);
<     lua_assert(base == ci->u.l.base);
<     lua_assert(base <= L->top && L->top < L->stack + L->stacksize);
>     vmfetch();

src/lvm.h

2c2
< ** $Id: lvm.h,v 2.39 2015/09/09 13:44:07 roberto Exp $
> ** $Id: lvm.h,v 2.40 2016/01/05 16:07:21 roberto Exp $

52,54c52,56
< ** fast track for 'gettable': 1 means 'aux' points to resulted value;
< ** 0 means 'aux' is metamethod (if 't' is a table) or NULL. 'f' is
< ** the raw get function to use.
> ** fast track for 'gettable': if 't' is a table and 't[k]' is not nil,
> ** return 1 with 'slot' pointing to 't[k]' (final result).  Otherwise,
> ** return 0 (meaning it will have to check metamethod) with 'slot'
> ** pointing to a nil 't[k]' (if 't' is a table) or NULL (otherwise).
> ** 'f' is the raw get function to use.

56c58
< #define luaV_fastget(L,t,k,aux,f) \
> #define luaV_fastget(L,t,k,slot,f) \

58,63c60,62
<    ? (aux = NULL, 0)  /* not a table; 'aux' is NULL and result is 0 */  \
<    : (aux = f(hvalue(t), k),  /* else, do raw access */  \
<       !ttisnil(aux) ? 1  /* result not nil? 'aux' has it */  \
<       : (aux = fasttm(L, hvalue(t)->metatable, TM_INDEX),  /* get metamethod */\
<          aux != NULL  ? 0  /* has metamethod? must call it */  \
<          : (aux = luaO_nilobject, 1))))  /* else, final result is nil */
>    ? (slot = NULL, 0)  /* not a table; 'slot' is NULL and result is 0 */  \
>    : (slot = f(hvalue(t), k),  /* else, do raw access */  \
>       !ttisnil(slot)))  /* result not nil? */

68,70c67,69
< #define luaV_gettable(L,t,k,v) { const TValue *aux; \
<   if (luaV_fastget(L,t,k,aux,luaH_get)) { setobj2s(L, v, aux); } \
<   else luaV_finishget(L,t,k,v,aux); }
> #define luaV_gettable(L,t,k,v) { const TValue *slot; \
>   if (luaV_fastget(L,t,k,slot,luaH_get)) { setobj2s(L, v, slot); } \
>   else luaV_finishget(L,t,k,v,slot); }

103c102
<                                StkId val, const TValue *tm);
>                                StkId val, const TValue *slot);

105c104
<                                StkId val, const TValue *oldval);
>                                StkId val, const TValue *slot);