Skip to content

Commit

Permalink
Explicitly check C-API Handle 'checksum'.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Jan 8, 2013
1 parent 75537c1 commit f9cb075
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vm/capi/handle.hpp
Expand Up @@ -87,12 +87,14 @@ namespace rubinius {
if(update_) (*update_)(env, this);
}

#define RBX_CAPI_HANDLE_CHECKSUM 0xffff

bool valid_p() const {
return checksum_ & 0xffff;
return checksum_ == RBX_CAPI_HANDLE_CHECKSUM;
}

void validate() {
checksum_ = 0xffff;
checksum_ = RBX_CAPI_HANDLE_CHECKSUM;
}

void invalidate() {
Expand Down

0 comments on commit f9cb075

Please sign in to comment.