A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Lua] Renamed host 'power' to 'speed' for hosts
[simgrid.git]
/
src
/
bindings
/
lua
/
lua_utils.c
diff --git
a/src/bindings/lua/lua_utils.c
b/src/bindings/lua/lua_utils.c
index 24bd4ab52369085528c1670593d0dafd848e3346..914e667a30206f51e84012d2dd63b1f9d4b07eac 100644
(file)
--- a/
src/bindings/lua/lua_utils.c
+++ b/
src/bindings/lua/lua_utils.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010
-2014
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-103,7
+103,8
@@
const char* sglua_get_spaces(int length) {
static char spaces[128];
static char spaces[128];
- xbt_assert(length < 128);
+ xbt_assert(length >= 0 && length < 128,
+ "Invalid indentation length: %d", length);
if (length != 0) {
memset(spaces, ' ', length);
}
if (length != 0) {
memset(spaces, ' ', length);
}
@@
-166,7
+167,7
@@
void* sglua_checkudata_debug(lua_State* L, int ud, const char* tname)
sglua_stack_dump("my_checkudata: ", L);
if (p == NULL || !lua_getmetatable(L, ud) || !lua_rawequal(L, -1, -2))
sglua_stack_dump("my_checkudata: ", L);
if (p == NULL || !lua_getmetatable(L, ud) || !lua_rawequal(L, -1, -2))
-
luaL_typerror(L, ud, tname
);
+
XBT_ERROR("Error: Userdata is NULL, couldn't find metatable or top of stack does not equal element below it."
);
lua_pop(L, 2);
return p;
}
lua_pop(L, 2);
return p;
}