Change literal value of s_none
symbol in PyrObject
#2638
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for #2614.
s_none
is needed in the current version of the class and primitive parser as a dummy symbol for "no superclass" or "no name", because other more serious dependency tests are performed usingnullptr
. However, the use of the symbol literalnone
caused the interpreter to crash if a method called "none" was added to a SC class, presumably because the parser would attempt to point the new method name to the existing dummy symbol and then run into problems later while dependencies were being constructed.By changing the literal definition of
s_none
to__none
I believe we solve this issue with minimal effort by keeping the symbol out of the method and primitive namespaces, while preserving the semantic value of the literal.To test, I modified the
BasicOpUGens.sc
file to begin:then built and tested sclang via command line:
I ran similar tests with
none
as a class method, classvar, instance var, and both classvar and instance var, all with similar positive results.