Skip to content

Commit

Permalink
Fix overwriting tag and mask on 32-bit system, when highest bit set i…
Browse files Browse the repository at this point in the history
…n payload value
  • Loading branch information
vivkin committed Apr 8, 2015
1 parent d09cd7a commit 23a1ebd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gason.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ union JsonValue {
}
JsonValue(JsonTag tag = JSON_NULL, void *payload = nullptr) {
assert((uint64_t)payload <= JSON_VALUE_PAYLOAD_MASK);
ival = JSON_VALUE_NAN_MASK | ((uint64_t)tag << JSON_VALUE_TAG_SHIFT) | (uint64_t)payload;
ival = JSON_VALUE_NAN_MASK | ((uint64_t)tag << JSON_VALUE_TAG_SHIFT) | (uintptr_t)payload;
}
bool isDouble() const {
return (int64_t)ival <= (int64_t)JSON_VALUE_NAN_MASK;
Expand Down

0 comments on commit 23a1ebd

Please sign in to comment.