diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-09-26 11:09:21 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-09-26 11:09:21 -0300 |
| commit | 56699cd6036a52abaf62a2d3097538b883d1edcb (patch) | |
| tree | 064bed7d8ecc08e6239fc9f9f54b9171dea5fb38 | |
| parent | 8ede2c353cddc8024f75802bb2ab714e334f1f8e (diff) | |
| download | lua-56699cd6036a52abaf62a2d3097538b883d1edcb.tar.gz lua-56699cd6036a52abaf62a2d3097538b883d1edcb.tar.bz2 lua-56699cd6036a52abaf62a2d3097538b883d1edcb.zip | |
small change to avoid bug in some versions of the clang compiler
| -rw-r--r-- | liolib.c | 9 |
1 files changed, 7 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: liolib.c,v 2.127 2014/06/30 19:48:08 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.128 2014/07/29 16:01:00 roberto Exp roberto $ |
| 3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -193,9 +193,14 @@ static LStream *newprefile (lua_State *L) { | |||
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | 195 | ||
| 196 | /* | ||
| 197 | ** Calls the 'close' function from a file handle. The 'volatile' avoids | ||
| 198 | ** a bug in some verisions of the Clang compiler (e.g., clang 3.0 for | ||
| 199 | ** 32 bits). | ||
| 200 | */ | ||
| 196 | static int aux_close (lua_State *L) { | 201 | static int aux_close (lua_State *L) { |
| 197 | LStream *p = tolstream(L); | 202 | LStream *p = tolstream(L); |
| 198 | lua_CFunction cf = p->closef; | 203 | volatile lua_CFunction cf = p->closef; |
| 199 | p->closef = NULL; /* mark stream as closed */ | 204 | p->closef = NULL; /* mark stream as closed */ |
| 200 | return (*cf)(L); /* close it */ | 205 | return (*cf)(L); /* close it */ |
| 201 | } | 206 | } |
