mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Only check lowest bit for _Bool type (https://github.com/Shopify/ruby/pull/412)
* Only check lowest bit for _Bool type The `test AL, AL` got lost during porting and we were generating `test RAX, RAX` instead. The upper bits of a `_Bool` return type is unspecified and we were failing `TestClass#test_singleton_class_should_has_own_namespace` due to interpreterting the return value incorrectly. * Enable test_class for test-all on x86_64
This commit is contained in:
parent
d57a9f61a0
commit
c70d1471c1
Notes:
git
2022-08-30 01:10:17 +09:00
1 changed files with 3 additions and 2 deletions
|
@ -5526,8 +5526,9 @@ fn gen_opt_getinlinecache(
|
|||
vec![inline_cache, Opnd::mem(64, CFP, RUBY_OFFSET_CFP_EP)]
|
||||
);
|
||||
|
||||
// Check the result. _Bool is one byte in SysV.
|
||||
asm.test(ret_val, ret_val);
|
||||
// Check the result. SysV only specifies one byte for _Bool return values,
|
||||
// so it's important we only check one bit to ignore the higher bits in the register.
|
||||
asm.test(ret_val, 1.into());
|
||||
asm.jz(counted_exit!(ocb, side_exit, opt_getinlinecache_miss).into());
|
||||
|
||||
let inline_cache = asm.load(Opnd::const_ptr(ic as *const u8));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue