Permalink
Browse files

Explicitly check C-API Handle 'checksum'.

  • Loading branch information...
brixen committed Jan 2, 2013
1 parent 75537c1 commit f9cb07565572f3dbd62dcd852b2001a58f8476d0
Showing with 4 additions and 2 deletions.
  1. +4 −2 vm/capi/handle.hpp
View
@@ -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() {

0 comments on commit f9cb075

Please sign in to comment.