cleanup StackedValue

master
Daniel Kolesa 2016-08-12 04:16:35 +01:00
parent a6d2cc0ef4
commit 93b2a59e58
1 changed files with 8 additions and 3 deletions

View File

@ -447,16 +447,21 @@ OSTD_EXPORT void init_libs(CsState &cs, int libs = CS_LIB_ALL);
struct OSTD_EXPORT StackedValue: TaggedValue {
StackedValue(Ident *id = nullptr):
TaggedValue(), p_id(id), p_stack(), p_pushed(false)
{}
TaggedValue(), p_id(nullptr), p_stack(), p_pushed(false)
{
set_id(id);
}
~StackedValue() {
pop();
}
bool set_id(Ident *id) {
if (!id || !id->is_alias()) {
return false;
}
p_id = id;
return p_id && p_id->is_alias();
return true;
}
Ident *get_id() const {