summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2010-06-21 13:57:14 -0700
committerPixel <pixel@nobis-crew.org>2010-06-21 13:57:14 -0700
commit7e92be6cd731888a4750bff54a0e03790afb3ab5 (patch)
tree65c1fbc40b8cc8de18e6ffe58931e6febfdda8a7
parent8abf31744c41eacee7ea835aca7866735a30a4f0 (diff)
Fixing stack abuses from HandleLua code...
-rw-r--r--lib/LuaHandle.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc
index 789876e..e23d059 100644
--- a/lib/LuaHandle.cc
+++ b/lib/LuaHandle.cc
@@ -1280,7 +1280,6 @@ bool HandleLua::CanRead() const {
L->call(1, 1);
r = L->toboolean();
L->pop();
- L->pop();
return r;
}
@@ -1301,7 +1300,6 @@ bool HandleLua::CanWrite() const {
L->call(1, 1);
r = L->toboolean();
L->pop();
- L->pop();
return r;
}
@@ -1322,7 +1320,6 @@ bool HandleLua::CanSeek() const {
L->call(1, 1);
r = L->toboolean();
L->pop();
- L->pop();
return r;
}
@@ -1343,7 +1340,6 @@ bool HandleLua::CanWatch() const {
L->call(1, 1);
r = L->toboolean();
L->pop();
- L->pop();
return r;
}
@@ -1364,7 +1360,6 @@ String HandleLua::GetName() const {
L->call(1, 1);
r = L->tostring();
L->pop();
- L->pop();
return r;
}
@@ -1385,7 +1380,6 @@ off_t HandleLua::tell() const {
L->call(1, 1);
r = L->tonumber();
L->pop();
- L->pop();
return r;
}
@@ -1406,7 +1400,6 @@ ssize_t HandleLua::GetSize() const {
L->call(1, 1);
r = L->tonumber();
L->pop();
- L->pop();
return r;
}
@@ -1427,7 +1420,6 @@ time_t HandleLua::GetModif() const {
L->call(1, 1);
r = L->tonumber();
L->pop();
- L->pop();
return r;
}
@@ -1438,12 +1430,12 @@ void HandleLua::Flush() {
if (L->isnil()) {
L->pop();
+ L->pop();
return;
}
L->insert(-2);
L->call(1, 0);
- L->pop();
}
off_t HandleLua::seek(off_t offset, int wheel) throw (GeneralException) {
@@ -1455,6 +1447,7 @@ off_t HandleLua::seek(off_t offset, int wheel) throw (GeneralException) {
if (L->isnil()) {
L->pop();
+ L->pop();
throw GeneralException("This HandleLua doesn't have any seek method (or can't seek maybe).");
}
@@ -1465,7 +1458,6 @@ off_t HandleLua::seek(off_t offset, int wheel) throw (GeneralException) {
r = L->tonumber();
L->pop();
- L->pop();
return r;
}
@@ -1478,6 +1470,7 @@ ssize_t HandleLua::read(void * buf, size_t count) throw (GeneralException) {
if (L->isnil()) {
L->pop();
+ L->pop();
throw GeneralException("This HandleLua doesn't have any read method (or can't read maybe).");
}
@@ -1501,7 +1494,6 @@ ssize_t HandleLua::read(void * buf, size_t count) throw (GeneralException) {
L->pop();
L->pop();
- L->pop();
return r;
}
@@ -1515,6 +1507,7 @@ ssize_t HandleLua::write(const void * buf, size_t count) throw (GeneralException
if (L->isnil()) {
L->pop();
+ L->pop();
throw GeneralException("This HandleLua doesn't have any write method (or can't write maybe).");
}
@@ -1526,7 +1519,6 @@ ssize_t HandleLua::write(const void * buf, size_t count) throw (GeneralException
r = L->tonumber();
L->pop();
- L->pop();
return r;
}