.
This commit is contained in:
@@ -51,7 +51,11 @@ void Stack::push_fp()
|
|||||||
|
|
||||||
void Stack::pop_fp()
|
void Stack::pop_fp()
|
||||||
{
|
{
|
||||||
|
if (fps_.size() == 1)
|
||||||
|
throw VMStackUnderflow();
|
||||||
|
|
||||||
|
stack_.resize(fps_.top());
|
||||||
|
fps_.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // tyche
|
} // tyche
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ enum class Type : uint8_t
|
|||||||
|
|
||||||
class Value {
|
class Value {
|
||||||
public:
|
public:
|
||||||
|
Value() : value_(std::monostate()) {}
|
||||||
|
|
||||||
static Value CreateNil() { return Value(std::monostate()); }
|
static Value CreateNil() { return Value(std::monostate()); }
|
||||||
static Value CreateInteger(int32_t v) { return Value(v); }
|
static Value CreateInteger(int32_t v) { return Value(v); }
|
||||||
static Value CreateFloat(float f) { return Value(f); }
|
static Value CreateFloat(float f) { return Value(f); }
|
||||||
|
|||||||
Reference in New Issue
Block a user