From 8895ee8fc58ff13e7ee17007aeab6f78bf9f81f1 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 13 Nov 2017 00:02:22 -0700 Subject: [PATCH] Fix assignment / modification of return values --- include/chaiscript/dispatchkit/boxed_number.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/chaiscript/dispatchkit/boxed_number.hpp b/include/chaiscript/dispatchkit/boxed_number.hpp index 2817ff1a..3e96a03e 100644 --- a/include/chaiscript/dispatchkit/boxed_number.hpp +++ b/include/chaiscript/dispatchkit/boxed_number.hpp @@ -327,7 +327,7 @@ namespace chaiscript { auto lhs_visit = [t_oper, &t_lhs, &t_rhs](const auto &c_lhs){ - auto *lhs = static_cast *>(t_lhs.get_ptr()); + auto *lhs = t_lhs.is_return_value()?nullptr:static_cast *>(t_lhs.get_ptr()); auto rhs_visit = [t_oper, &t_lhs, lhs, &c_lhs](const auto &c_rhs) { return go(t_oper, t_lhs, lhs, c_lhs, c_rhs);