diff options
-rw-r--r-- | jim-aio.c | 9 | ||||
-rw-r--r-- | regtest.tcl | 7 |
2 files changed, 16 insertions, 0 deletions
@@ -1170,6 +1170,15 @@ static int aio_cmd_puts(Jim_Interp *interp, int argc, Jim_Obj *const *argv) /* Keep it simple and always go via the writebuf instead of trying to optimise * the case that we can write immediately */ +#ifdef JIM_MAINTAINER + if (Jim_IsShared(af->writebuf)) { + /* This should generally never happen since this object isn't accessible, + * but it is possible with 'debug objects' */ + Jim_DecrRefCount(interp, af->writebuf); + af->writebuf = Jim_DuplicateObj(interp, af->writebuf); + Jim_IncrRefCount(af->writebuf); + } +#endif Jim_AppendObj(interp, af->writebuf, strObj); if (nl) { Jim_AppendString(interp, af->writebuf, "\n", 1); diff --git a/regtest.tcl b/regtest.tcl index 5e66aa3..99a65fe 100644 --- a/regtest.tcl +++ b/regtest.tcl @@ -399,6 +399,13 @@ set json { catch {json::decode $json} puts "TEST 56 PASSED" +if {[exists -command debug]} { + set f [open /dev/null w] + $f puts [debug objects] + $f close +} +puts "TEST 57 PASSED" + # TAKE THE FOLLOWING puts AS LAST LINE puts "--- ALL TESTS PASSED ---" |