summaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-09-26 11:09:21 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-09-26 11:09:21 -0300
commit56699cd6036a52abaf62a2d3097538b883d1edcb (patch)
tree064bed7d8ecc08e6239fc9f9f54b9171dea5fb38 /liolib.c
parent8ede2c353cddc8024f75802bb2ab714e334f1f8e (diff)
downloadlua-56699cd6036a52abaf62a2d3097538b883d1edcb.tar.gz
lua-56699cd6036a52abaf62a2d3097538b883d1edcb.tar.bz2
lua-56699cd6036a52abaf62a2d3097538b883d1edcb.zip
small change to avoid bug in some versions of the clang compiler
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/liolib.c b/liolib.c
index 42dcb7ef..b5f7af7b 100644
--- a/liolib.c
+++ b/liolib.c
@@ -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*/
196static int aux_close (lua_State *L) { 201static 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}