Skip to content

Incorrect check whether exceptions are enabled #1346

@Immortalety

Description

@Immortalety
#ifndef SOL_STACK_GUARD_HPP
#define SOL_STACK_GUARD_HPP

#include <sol/compatibility/lua_version.hpp>
#include <sol/error.hpp>
#include <functional>

namespace sol {
	namespace detail {
		inline void stack_fail(int, int) {
#if SOL_IS_OFF(SOL_EXCEPTIONS_I_)
			throw error(detail::direct_error, "imbalanced stack after operation finish");
#else
			// Lol, what do you want, an error printout? :3c
			// There's no sane default here. The right way would be C-style abort(), and that's not acceptable, so
			// hopefully someone will register their own stack_fail thing for the `fx` parameter of stack_guard.
#endif // No Exceptions
		}
	} // namespace detail

Instead of #if SOL_IS_OFF(SOL_EXCEPTIONS_I_) there should be #if SOL_IS_ON(SOL_EXCEPTIONS_I_)

Metadata

Metadata

Assignees

Labels

Bug.DerpThey don't call me The Phantom Derpstorm for no reason.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions