Skip to content
Tcl Source Code History Of Ticket 575194ffff
Login

History Of Ticket 575194ffff

Artifacts Associated With Ticket 575194ffff

  1. Ticket change [46c8ff16b8] (rid 99573) by pspjuth on 2002-06-28 20:56:25:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      In compile code (e.g. tclCompCmds.c) the combo
      TclEmitPush and TclRegisterLiteral is rather common.
      Typically:
      
      TclEmitPush(TclRegisterLiteral(envPtr,
              valueTokenPtr[1].start, valueTokenPtr[1].size,
              /*onHeap*/ 0), envPtr);
      
      However, TclEmitPush is a macro which uses its first
      argument eight times and passes it at least three times,
      which makes the above statement rather wasteful.
      
      This is normally not any danger since TclRegisterLiteral
      can be called repeatedly without anything changing, if
      onHeap is 0 which is the normal case.
      With onHeap = 1, it becomes disaster since the
      successive calls deallocates the string. A naughty
      trap for an innocent coder who likes to copy code
      nearby :-)
      
      So, either a big warning sign should be placed on
      TclEmitPush and every use of the combo should be
      rewritten so the literal index is stored in a var first:
      
      objIndex = TclRegisterLiteral(envPtr,
              valueTokenPtr[1].start, valueTokenPtr[1].size,
              /*onHeap*/ 0);
      TclEmitPush(objIndex, envPtr);
      
      or, maybe TclEmitPush can be recoded to something
      better, like a function or e.g.:
      
      #define TclEmitPush(objIndex, envPtr) \
          { register int __objIndex__ = (objIndex); \
          if ((__objIndex__) <= 255) { \
      TclEmitInstInt1(INST_PUSH1, (__objIndex__),\
      (envPtr)); \
          } else { \
      TclEmitInstInt4(INST_PUSH4, (__objIndex__),\
      (envPtr)); \
          } \
          }
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "pspjuth"
    9. subsystem initialized to: "47. Bytecode Compiler"
    10. title initialized to: "Wasteful code in compile"
    11. type initialized to: "Bug"
  2. Ticket change [7221f74cf8] (rid 100806) by andreas_kupries on 2002-06-29 04:01:18:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      Recoding things to use RegisterLiteral only once should also 
      speed up the compiler, as it doesn't have to call the function 
      multiple times. Expensive calls I guess.
      
      Prio up.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. priority changed to: "7 High"
    5. username: "andreas_kupries"
  3. Ticket change [e337a7af7e] (rid 87753) by msofer on 2002-06-29 04:25:54:

    1. closedate changed to: "2002-06-28T21:25:54"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      Thanks for catching that; fixed. 
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "msofer"