[#111712] [Ruby master Feature#19322] Support spawning "private" child processes — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5MzIyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtqdHNhbmFrdHNpZGlzIChLSiBUc2Fu
14 messages
2023/01/07
[ruby-core:111811] [Ruby master Bug#19339] Defining ivar on special constants with @ syntax causes segv
From:
"luke-gru (Luke Gruber) via ruby-core" <ruby-core@...>
Date:
2023-01-14 21:02:53 UTC
List:
ruby-core #111811
Issue #19339 has been reported by luke-gru (Luke Gruber).
----------------------------------------
Bug #19339: Defining ivar on special constants with @ syntax causes segv
https://bugs.ruby-lang.org/issues/19339
* Author: luke-gru (Luke Gruber)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
```ruby
1.instance_eval do
@a = 1
end
```
There's a missing check at the top of vm_setivar_fastpath, should be:
```c
if (UNLIKELY(RB_SPECIAL_CONST_P(obj))) { // example code: 1.instance_eval { @a = 1 }
rb_check_frozen(obj); // raise FrozenError, because it's always frozen
return Qundef;
}
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/