From: Tobias Markus Date: Fri, 27 Feb 2015 16:24:48 +0000 (+0100) Subject: Fix all #29358 issues X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=82bb12ef9e35fb9af8fab2de99ad853f57391d33;p=supertux.git Fix all #29358 issues --- diff --git a/src/worldmap/worldmap.cpp b/src/worldmap/worldmap.cpp index 4aa05c736..f6be69f31 100644 --- a/src/worldmap/worldmap.cpp +++ b/src/worldmap/worldmap.cpp @@ -1034,16 +1034,25 @@ WorldMap::save_state() store_bool(vm, "perfect", level->perfect); level->statistics.serialize_to_squirrel(vm); - sq_newslot(vm, -3, SQFalse); + if(SQ_FAILED(sq_newslot(vm, -3, SQFalse))) + { + throw std::runtime_error("failed to create '" + name + "' table entry"); + } } - sq_newslot(vm, -3, SQFalse); + if(SQ_FAILED(sq_newslot(vm, -3, SQFalse))) + { + throw std::runtime_error("failed to create '" + name + "' table entry"); + } // overall statistics... total_stats.serialize_to_squirrel(vm); // push world into worlds table - sq_newslot(vm, -3, SQFalse); + if(SQ_FAILED(sq_newslot(vm, -3, SQFalse))) + { + throw std::runtime_error("failed to create '" + name + "' table entry"); + } } catch(std::exception& ) { sq_settop(vm, oldtop); }