Skip to content

Commit

Permalink
fix nested non-control local scope variable cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Jun 21, 2024
1 parent 15e3343 commit c56efce
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
24 changes: 14 additions & 10 deletions VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ChucK VERSIONS log
=======
- (updated) chugin API version from 10.1 to 10.2
- (added) chugin API for callback on shutdown
- (added) chugin API for setting array elements (thanks @AndrewAday)
- (added) chugin API for setting array elements (thanks azaday)
- (added) overloaded constructors added (more to come)
==================
Envelope( dur durationToTarget )
Expand Down Expand Up @@ -34,14 +34,13 @@ ChucK VERSIONS log
- (added) new member functions
==================
fun dur Envelope.ramp( dur durationToTarget, float target );
Over the given duration, ramp toward the specified target; returns the given
duration.
Over the given duration, ramp toward the specified target; returns the given
duration.
fun dur Envelope.ramp( float secondsToTarget, float target );
Over the given duration (in seconds), ramp toward the specified target; returns the
given duration.
Over the given duration (in seconds), ramp toward the specified target; returns
the given duration.
==================
examples/basic/envelope2.ck
- (added) command line query system `--query:<name>`
- (added) examples/basic/envelope2.ck -- to show Envelope.ramp() in action
- (added) examples/deep/smb.ck -- a ChucK rendition of Super Mario Bros.
original theme by Koji Kondo; (meticulously) modeled in ChucK by
Wesley Burchell in 2017
Expand All @@ -50,10 +49,15 @@ ChucK VERSIONS log
- (added) examples/special/scream-o-matic/scream-o-matic.ck -- using
multiple LiSas for granular synthesis, to make continuous
scream generator
- (added) command line query system `--query:<name>`
- (added) Type type added to CKDoc script and deployed online:
https://chuck.stanford.edu/doc/reference/utils.html#Type
- (added) CKDoc.sort( int ) -- toggle alphabetical sorting of functions and variables
within Type documentation generation (thanks azaday)
- (fixed) globals events system synchronization (FYI this fixes a long-running,
elusive Chunity crashing bug involving various syncers)
- (fixed) local non-control structure local scope Objects now correctly cleaned
up at the end of local scope


1.5.2.4 (April 2024)
Expand All @@ -69,10 +73,10 @@ ChucK VERSIONS log
1.5.2.3 (April 2024)
=======
- (fixed) regression issue with connecting arrays of mono UGens to
non-mono ugens; e.g., `Gain a[2] => dac;`
FYI examples/stereo/ugen-array.ck now works once again
non-mono ugens; e.g., `Gain a[2] => dac;`
FYI examples/stereo/ugen-array.ck now works once again
- (updated) examples/array/array_ugens.ck contains additional
examples of array of ugens connecting with stereo ugens
examples of array of ugens connecting with stereo ugens


1.5.2.2 (March 2024)
Expand Down
5 changes: 5 additions & 0 deletions src/core/chuck_emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,12 @@ t_CKBOOL emit_engine_emit_stmt( Chuck_Emitter * emit, a_Stmt stmt, t_CKBOOL pop
break;

case ae_stmt_code: // code segment
// push scope | 1.5.2.5 (ge)
emit->push_scope();
// { code }
ret = emit_engine_emit_code_segment( emit, &stmt->stmt_code );
// pop scope | 1.5.2.5 (ge)
emit->pop_scope();
break;

case ae_stmt_switch: // switch statement
Expand Down
2 changes: 2 additions & 0 deletions src/core/chuck_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,9 @@ t_CKBOOL type_engine_check_stmt( Chuck_Env * env, a_Stmt stmt )

case ae_stmt_code:
env->class_scope++;
env->curr->value.push(); // 1.5.2.5 (ge) added
ret = type_engine_check_code_segment( env, &stmt->stmt_code );
env->curr->value.pop(); // 1.5.2.5 (ge) added
env->class_scope--;
break;

Expand Down

0 comments on commit c56efce

Please sign in to comment.