Skip to content

Commit bc1611e

Browse files
committed
update
1 parent edbb2a7 commit bc1611e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/script/cond_stack.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const testing = std.testing;
66
pub const ConditionalStackError = error{
77
StackUnderflow,
88
OutOfMemory,
9-
InvalidValue,
109
};
1110

1211
pub const ConditionalValues = enum(u8) {
@@ -44,6 +43,9 @@ pub const ConditionalStack = struct {
4443

4544
/// Delete an item from the stack
4645
pub fn delete(self: *ConditionalStack) ConditionalStackError!void {
46+
if (self.stack.items.len == 0) {
47+
return ConditionalStackError.OutOfMemory;
48+
}
4749
self.stack.items.len -= 1;
4850
}
4951

0 commit comments

Comments
 (0)