dandruff / xCT

A light weight scrolling combat text implementation.
53 stars 22 forks source link

Leaking global variables #18

Closed ckaotik closed 11 years ago

ckaotik commented 12 years ago

Hey, I just ran findglobals against xct.lua and it found quite a few "issues" ;) While API calls shouldn't worry you, some variables like _, f, lowHealth or lowMana with such a commonly used name shouldn't fly around freely in the global variable namespace.

So here's the dump:

main <xCT.lua:0,0> (1607 instructions, 6428 bytes at 0x107b01790)
    [16]    SETGLOBAL   0 -1    ; XCT_DEBUG
    [27]    SETGLOBAL   1 -5    ; xCT
    [541]   SETGLOBAL   6 -212  ; xCTdmg
    [548]   SETGLOBAL   6 -216  ; xCTheal
    [1191]  SETGLOBAL   23 -234 ; DAMAGE_TEXT_FONT
    [1769]  SETGLOBAL   29 -401 ; SLASH_XCT1
    [2221]  SETGLOBAL   29 -435 ; loadstacktracker
function AssignTalentTree() <xCT.lua:79,239> (277 instructions, 1108 bytes at 0x107b01e20)
    [82]    GETGLOBAL   0 -1    ; XCT_ISMOP
    [83]    GETGLOBAL   1 -3    ; GetSpecialization
    [83]    GETGLOBAL   4 -4    ; GetActiveSpecGroup
    [85]    GETGLOBAL   1 -5    ; GetPrimaryTalentTree
    [85]    GETGLOBAL   4 -6    ; GetActiveTalentGroup
    [228]   GETGLOBAL   0 -48   ; loadstacktracker
    [235]   GETGLOBAL   0 -51   ; COMBAT_TEXT_SHOW_COMBO_POINTS
GetSpellTextureFormatted = function(spellID, iconSize)  <xCT.lua:600,626> (68 instructions, 272 bytes at 0x107b02770)
    [603]   GETGLOBAL   3 -3    ; PET_ATTACK_TEXTURE
    [604]   GETGLOBAL   4 -5    ; GetSpellInfo
    [606]   GETGLOBAL   3 -5    ; GetSpellInfo
    [610]   GETGLOBAL   4 -8    ; print
    [614]   GETGLOBAL   3 -3    ; PET_ATTACK_TEXTURE
    [615]   GETGLOBAL   4 -3    ; PET_ATTACK_TEXTURE
    [617]   GETGLOBAL   3 -13   ; GetSpellTexture
function SetUnit()  <xCT.lua:643,650> (15 instructions, 60 bytes at 0x107b01d20)
    [644]   GETGLOBAL   0 -1    ; UnitHasVehicleUI
    [649]   GETGLOBAL   0 -5    ; CombatTextSetActiveUnit
function ScrollDirection()  <xCT.lua:681,691> (28 instructions, 112 bytes at 0x107b04340)
    [682]   GETGLOBAL   0 -1    ; COMBAT_TEXT_FLOAT_MODE
function AlignGridShow()    <xCT.lua:698,783> (293 instructions, 1172 bytes at 0x107b04820)
    [700]   GETGLOBAL   0 -1    ; CreateFrame
    [700]   GETGLOBAL   3 -3    ; UIParent
    [701]   GETGLOBAL   2 -3    ; UIParent
    [705]   GETGLOBAL   1 -6    ; GetScreenWidth
    [705]   GETGLOBAL   2 -7    ; GetScreenHeight
function ChatMsgMoney_Handler(msg)  <xCT.lua:795,807> (107 instructions, 428 bytes at 0x107b058f0)
    [796]   GETGLOBAL   1 -1    ; tonumber
    [796]   GETGLOBAL   4 -3    ; GOLD_AMOUNT
    [796]   GETGLOBAL   2 -1    ; tonumber
    [796]   GETGLOBAL   5 -7    ; SILVER_AMOUNT
    [796]   GETGLOBAL   3 -1    ; tonumber
    [796]   GETGLOBAL   6 -8    ; COPPER_AMOUNT
    [797]   GETGLOBAL   5 -12   ; MONEY
    [802]   GETGLOBAL   7 -20   ; GetCoinTextureString
    [805]   GETGLOBAL   6 -25   ; xCTloot
    [805]   GETGLOBAL   6 -26   ; xCTgen
function ChatMsgLoot_Handler(msg)   <xCT.lua:809,852> (171 instructions, 684 bytes at 0x107b05ae0)
    [810]   GETGLOBAL   1 -1    ; select
    [810]   GETGLOBAL   3 -3    ; string
    [811]   GETGLOBAL   6 -1    ; select
    [811]   GETGLOBAL   8 -5    ; GetItemInfo
    [816]   GETGLOBAL   15 -9   ; tonumber
    [820]   GETGLOBAL   15 -15  ; LOOT_ITEM_CREATED_SELF
    [821]   GETGLOBAL   15 -20  ; LOOT_ITEM_PUSHED_SELF
    [821]   GETGLOBAL   15 -21  ; LOOT_ITEM_SELF
    [821]   GETGLOBAL   15 -15  ; LOOT_ITEM_CREATED_SELF
    [827]   GETGLOBAL   15 -28  ; GetItemQualityColor
    [830]   GETGLOBAL   21 -33  ; _G
    [846]   GETGLOBAL   21 -45  ; GetItemCount
    [850]   GETGLOBAL   19 -47  ; xCTloot
    [850]   GETGLOBAL   19 -48  ; xCTgen
function OnEvent(self, event, subevent, ...)    <xCT.lua:859,1187> (1179 instructions, 4716 bytes at 0x107b06aa0)
    [861]   GETGLOBAL   3 -2    ; select
    [862]   GETGLOBAL   5 -4    ; SHOW_COMBAT_TEXT
    [866]   GETGLOBAL   5 -7    ; xCTdmg
    [869]   GETGLOBAL   5 -7    ; xCTdmg
    [872]   GETGLOBAL   5 -7    ; xCTdmg
    [875]   GETGLOBAL   5 -7    ; xCTdmg
    [880]   GETGLOBAL   5 -22   ; COMBAT_TEXT_SHOW_FRIENDLY_NAMES
    [881]   GETGLOBAL   5 -24   ; xCTheal
    [883]   GETGLOBAL   5 -24   ; xCTheal
    [891]   GETGLOBAL   5 -22   ; COMBAT_TEXT_SHOW_FRIENDLY_NAMES
    [892]   GETGLOBAL   5 -24   ; xCTheal
    [894]   GETGLOBAL   5 -24   ; xCTheal
    [901]   GETGLOBAL   5 -24   ; xCTheal
    [906]   GETGLOBAL   5 -31   ; xCTproc
    [906]   GETGLOBAL   5 -32   ; xCTgen
    [908]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [909]   GETGLOBAL   5 -7    ; xCTdmg
    [909]   GETGLOBAL   7 -35   ; MISS
    [911]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [912]   GETGLOBAL   5 -7    ; xCTdmg
    [912]   GETGLOBAL   7 -37   ; DODGE
    [914]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [915]   GETGLOBAL   5 -7    ; xCTdmg
    [915]   GETGLOBAL   7 -38   ; PARRY
    [917]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [918]   GETGLOBAL   5 -7    ; xCTdmg
    [918]   GETGLOBAL   7 -39   ; EVADE
    [920]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [924]   GETGLOBAL   6 -40   ; IMMUNE
    [929]   GETGLOBAL   6 -51   ; time
    [934]   GETGLOBAL   5 -7    ; xCTdmg
    [934]   GETGLOBAL   7 -40   ; IMMUNE
    [937]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [938]   GETGLOBAL   5 -7    ; xCTdmg
    [938]   GETGLOBAL   7 -53   ; DEFLECT
    [940]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [941]   GETGLOBAL   5 -7    ; xCTdmg
    [941]   GETGLOBAL   7 -54   ; REFLECT
    [943]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [944]   GETGLOBAL   5 -7    ; xCTdmg
    [944]   GETGLOBAL   7 -35   ; MISS
    [946]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [947]   GETGLOBAL   5 -7    ; xCTdmg
    [947]   GETGLOBAL   7 -37   ; DODGE
    [949]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [950]   GETGLOBAL   5 -7    ; xCTdmg
    [950]   GETGLOBAL   7 -38   ; PARRY
    [952]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [953]   GETGLOBAL   5 -7    ; xCTdmg
    [953]   GETGLOBAL   7 -39   ; EVADE
    [955]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [959]   GETGLOBAL   6 -40   ; IMMUNE
    [964]   GETGLOBAL   6 -51   ; time
    [969]   GETGLOBAL   5 -7    ; xCTdmg
    [969]   GETGLOBAL   7 -40   ; IMMUNE
    [972]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [973]   GETGLOBAL   5 -7    ; xCTdmg
    [973]   GETGLOBAL   7 -53   ; DEFLECT
    [975]   GETGLOBAL   5 -36   ; COMBAT_TEXT_SHOW_DODGE_PARRY_MISS
    [976]   GETGLOBAL   5 -7    ; xCTdmg
    [976]   GETGLOBAL   7 -54   ; REFLECT
    [980]   GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [981]   GETGLOBAL   5 -7    ; xCTdmg
    [981]   GETGLOBAL   10 -62  ; RESIST
    [983]   GETGLOBAL   5 -7    ; xCTdmg
    [985]   GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [986]   GETGLOBAL   5 -7    ; xCTdmg
    [986]   GETGLOBAL   7 -62   ; RESIST
    [991]   GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [992]   GETGLOBAL   5 -7    ; xCTdmg
    [992]   GETGLOBAL   10 -65  ; BLOCK
    [994]   GETGLOBAL   5 -7    ; xCTdmg
    [996]   GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [997]   GETGLOBAL   5 -7    ; xCTdmg
    [997]   GETGLOBAL   7 -65   ; BLOCK
    [1002]  GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [1003]  GETGLOBAL   5 -7    ; xCTdmg
    [1003]  GETGLOBAL   10 -66  ; ABSORB
    [1005]  GETGLOBAL   5 -7    ; xCTdmg
    [1007]  GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [1008]  GETGLOBAL   5 -7    ; xCTdmg
    [1008]  GETGLOBAL   7 -66   ; ABSORB
    [1013]  GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [1014]  GETGLOBAL   5 -7    ; xCTdmg
    [1014]  GETGLOBAL   10 -62  ; RESIST
    [1016]  GETGLOBAL   5 -7    ; xCTdmg
    [1018]  GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [1019]  GETGLOBAL   5 -7    ; xCTdmg
    [1019]  GETGLOBAL   7 -62   ; RESIST
    [1024]  GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [1025]  GETGLOBAL   5 -7    ; xCTdmg
    [1025]  GETGLOBAL   10 -65  ; BLOCK
    [1027]  GETGLOBAL   5 -7    ; xCTdmg
    [1029]  GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [1030]  GETGLOBAL   5 -7    ; xCTdmg
    [1030]  GETGLOBAL   7 -65   ; BLOCK
    [1035]  GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [1036]  GETGLOBAL   5 -7    ; xCTdmg
    [1036]  GETGLOBAL   10 -66  ; ABSORB
    [1038]  GETGLOBAL   5 -7    ; xCTdmg
    [1040]  GETGLOBAL   5 -63   ; COMBAT_TEXT_SHOW_RESISTANCES
    [1041]  GETGLOBAL   5 -7    ; xCTdmg
    [1041]  GETGLOBAL   7 -66   ; ABSORB
    [1044]  GETGLOBAL   5 -71   ; COMBAT_TEXT_SHOW_ENERGIZE
    [1045]  GETGLOBAL   5 -72   ; tonumber
    [1047]  GETGLOBAL   5 -80   ; xCTpwr
    [1047]  GETGLOBAL   5 -32   ; xCTgen
    [1047]  GETGLOBAL   10 -82  ; _G
    [1047]  GETGLOBAL   8 -83   ; PowerBarColor
    [1047]  GETGLOBAL   9 -83   ; PowerBarColor
    [1047]  GETGLOBAL   10 -83  ; PowerBarColor
    [1051]  GETGLOBAL   5 -88   ; COMBAT_TEXT_SHOW_PERIODIC_ENERGIZE
    [1052]  GETGLOBAL   5 -72   ; tonumber
    [1054]  GETGLOBAL   5 -80   ; xCTpwr
    [1054]  GETGLOBAL   5 -32   ; xCTgen
    [1054]  GETGLOBAL   10 -82  ; _G
    [1054]  GETGLOBAL   8 -83   ; PowerBarColor
    [1054]  GETGLOBAL   9 -83   ; PowerBarColor
    [1054]  GETGLOBAL   10 -83  ; PowerBarColor
    [1058]  GETGLOBAL   5 -90   ; COMBAT_TEXT_SHOW_AURAS
    [1059]  GETGLOBAL   5 -92   ; print
    [1070]  GETGLOBAL   5 -32   ; xCTgen
    [1072]  GETGLOBAL   5 -90   ; COMBAT_TEXT_SHOW_AURAS
    [1073]  GETGLOBAL   5 -92   ; print
    [1084]  GETGLOBAL   5 -32   ; xCTgen
    [1086]  GETGLOBAL   5 -101  ; COMBAT_TEXT_SHOW_HONOR_GAINED
    [1087]  GETGLOBAL   5 -72   ; tonumber
    [1088]  GETGLOBAL   5 -102  ; abs
    [1089]  GETGLOBAL   5 -103  ; floor
    [1091]  GETGLOBAL   5 -32   ; xCTgen
    [1091]  GETGLOBAL   7 -104  ; HONOR
    [1095]  GETGLOBAL   5 -106  ; COMBAT_TEXT_SHOW_REPUTATION
    [1096]  GETGLOBAL   5 -32   ; xCTgen
    [1098]  GETGLOBAL   5 -108  ; COMBAT_TEXT_SHOW_REACTIVES
    [1099]  GETGLOBAL   5 -32   ; xCTgen
    [1103]  GETGLOBAL   3 -110  ; COMBAT_TEXT_SHOW_LOW_HEALTH_MANA
    [1105]  GETGLOBAL   3 -112  ; UnitHealth
    [1105]  GETGLOBAL   4 -113  ; UnitHealthMax
    [1105]  GETGLOBAL   4 -114  ; COMBAT_TEXT_LOW_HEALTH_THRESHOLD
    [1106]  GETGLOBAL   3 -115  ; lowHealth
    [1107]  GETGLOBAL   3 -32   ; xCTgen
    [1107]  GETGLOBAL   5 -116  ; HEALTH_LOW
    [1108]  SETGLOBAL   3 -115  ; lowHealth
    [1111]  SETGLOBAL   3 -115  ; lowHealth
    [1115]  GETGLOBAL   3 -110  ; COMBAT_TEXT_SHOW_LOW_HEALTH_MANA
    [1117]  GETGLOBAL   3 -118  ; UnitPowerType
    [1118]  GETGLOBAL   5 -119  ; UnitPower
    [1118]  GETGLOBAL   6 -120  ; UnitPowerMax
    [1118]  GETGLOBAL   6 -121  ; COMBAT_TEXT_LOW_MANA_THRESHOLD
    [1119]  GETGLOBAL   5 -122  ; lowMana
    [1120]  GETGLOBAL   5 -32   ; xCTgen
    [1120]  GETGLOBAL   7 -123  ; MANA_LOW
    [1121]  SETGLOBAL   5 -122  ; lowMana
    [1124]  SETGLOBAL   5 -122  ; lowMana
    [1128]  GETGLOBAL   3 -125  ; COMBAT_TEXT_SHOW_COMBAT_STATE
    [1129]  GETGLOBAL   3 -32   ; xCTgen
    [1129]  GETGLOBAL   6 -126  ; LEAVING_COMBAT
    [1131]  GETGLOBAL   3 -125  ; COMBAT_TEXT_SHOW_COMBAT_STATE
    [1132]  GETGLOBAL   3 -32   ; xCTgen
    [1132]  GETGLOBAL   6 -128  ; ENTERING_COMBAT
    [1146]  GETGLOBAL   5 -134  ; GetRuneType
    [1147]  GETGLOBAL   6 -135  ; COMBAT_TEXT_RUNE
    [1156]  GETGLOBAL   7 -80   ; xCTpwr
    [1156]  GETGLOBAL   7 -32   ; xCTgen
    [1161]  GETGLOBAL   3 -141  ; arg1
    [1173]  GETGLOBAL   4 -148  ; UnitGUID
function(message, scrollFunction, r, g, b, displayType, isStaggered)    <xCT.lua:1389,1393> (15 instructions, 60 bytes at 0x107b09500)
    [1390]  GETGLOBAL   7 -1    ; COMBAT_TEXT_TO_ANIMATE
    [1390]  GETGLOBAL   8 -1    ; COMBAT_TEXT_TO_ANIMATE
    [1391]  GETGLOBAL   8 -2    ; CombatText_RemoveMessage
    [1392]  GETGLOBAL   8 -3    ; xCTgen
ns.pr = function(msg)   <xCT.lua:1399,1401> (7 instructions, 28 bytes at 0x107b09810)
    [1400]  GETGLOBAL   1 -1    ; print
    [1400]  GETGLOBAL   3 -3    ; tostring
StartConfigmode = function()    <xCT.lua:1406,1554> (441 instructions, 1764 bytes at 0x107b09d30)
    [1407]  GETGLOBAL   0 -1    ; InCombatLockdown
    [1424]  GETGLOBAL   7 -37   ; DAMAGE
    [1427]  GETGLOBAL   7 -41   ; SHOW_COMBAT_HEALING
    [1430]  GETGLOBAL   7 -43   ; COMBAT_TEXT_LABEL
    [1433]  GETGLOBAL   7 -45   ; SCORE_DAMAGE_DONE
    [1433]  GETGLOBAL   9 -47   ; SCORE_HEALING_DONE
    [1436]  GETGLOBAL   7 -49   ; LOOT
    [1507]  GETGLOBAL   5 -86   ; GetScreenWidth
    [1507]  GETGLOBAL   6 -87   ; GetScreenHeight
function(...)   <xCT.lua:1517,1521> (45 instructions, 180 bytes at 0x107b0add0)
    [1518]  GETGLOBAL   2 -3    ; math
    [1518]  GETGLOBAL   4 -3    ; math
    [1519]  GETGLOBAL   2 -3    ; math
    [1520]  GETGLOBAL   2 -3    ; math
function EndConfigmode(showWarning) <xCT.lua:1556,1587> (65 instructions, 260 bytes at 0x107b0bd10)
    [1559]  SETGLOBAL   5 -3    ; f
    [1560]  GETGLOBAL   5 -3    ; f
    [1561]  GETGLOBAL   5 -3    ; f
    [1562]  GETGLOBAL   5 -3    ; f
    [1563]  GETGLOBAL   5 -3    ; f
    [1564]  GETGLOBAL   5 -3    ; f
    [1565]  GETGLOBAL   5 -3    ; f
    [1566]  GETGLOBAL   5 -3    ; f
    [1569]  GETGLOBAL   5 -3    ; f
    [1570]  GETGLOBAL   5 -3    ; f
    [1571]  GETGLOBAL   5 -3    ; f
    [1572]  GETGLOBAL   5 -3    ; f
    [1586]  GETGLOBAL   1 -19   ; collectgarbage
function StartTestMode()    <xCT.lua:1592,1733> (78 instructions, 312 bytes at 0x107b05160)
    [1594]  GETGLOBAL   0 -1    ; math
    [1595]  GETGLOBAL   2 -3    ; time
    [1595]  GETGLOBAL   2 -3    ; time
function(self, elapsed) <xCT.lua:1624,1730> (465 instructions, 1860 bytes at 0x107b0d260)
    [1631]  GETGLOBAL   2 -12   ; COMBAT_TEXT_SHOW_FRIENDLY_NAMES
    [1632]  GETGLOBAL   4 -16   ; UnitName
    [1637]  GETGLOBAL   4 -24   ; COMBAT_TEXT_LABEL
    [1645]  GETGLOBAL   6 -31   ; GetSpellInfo
    [1645]  SETGLOBAL   7 -30   ; _
    [1645]  SETGLOBAL   6 -30   ; _
    [1660]  GETGLOBAL   8 -39   ; unpack
    [1666]  GETGLOBAL   5 -43   ; MONEY
    [1666]  GETGLOBAL   7 -45   ; GetCoinTextureString
    [1679]  GETGLOBAL   6 -31   ; GetSpellInfo
    [1679]  SETGLOBAL   7 -30   ; _
    [1679]  SETGLOBAL   6 -30   ; _
    [1692]  GETGLOBAL   8 -39   ; unpack
    [1698]  GETGLOBAL   8 -55   ; _G
    [1698]  GETGLOBAL   6 -56   ; PowerBarColor
    [1698]  GETGLOBAL   7 -56   ; PowerBarColor
    [1698]  GETGLOBAL   8 -56   ; PowerBarColor
    [1718]  GETGLOBAL   5 -65   ; tostring
OnAccept     = function()   <xCT.lua:1751,1757> (10 instructions, 40 bytes at 0x107b0cbc0)
    [1752]  GETGLOBAL   0 -1    ; InCombatLockdown
    [1753]  GETGLOBAL   0 -2    ; ReloadUI
function(input) <xCT.lua:1770,1828> (124 instructions, 496 bytes at 0x107b0dbc0)
    [1771]  GETGLOBAL   1 -1    ; string
    [1796]  GETGLOBAL   2 -14   ; StaticPopup_Show
    [1814]  GETGLOBAL   2 -22   ; InterfaceOptionsFrame
    [1815]  GETGLOBAL   2 -24   ; InterfaceOptionsFrameCategoriesButton8
    [1818]  GETGLOBAL   2 -27   ; XCT_DEBUG
    [1819]  SETGLOBAL   2 -28   ; xCTPlus_SavedVars
    [1820]  GETGLOBAL   2 -29   ; ReloadUI
    [1824]  GETGLOBAL   2 -31   ; print
    [1825]  GETGLOBAL   2 -31   ; print
    [1826]  GETGLOBAL   2 -31   ; print
function(...)   <xCT.lua:1833,1843> (22 instructions, 88 bytes at 0x107b0e400)
    [1834]  GETGLOBAL   0 -1    ; GetShapeshiftForm
    [1836]  GETGLOBAL   0 -4    ; SetCVar
    [1840]  GETGLOBAL   0 -4    ; SetCVar
ct.SpamQueue=function(spellId, add) <xCT.lua:1860,1869> (15 instructions, 60 bytes at 0x107b0eb10)
    [1863]  GETGLOBAL   4 -2    ; type
function(self, elapsed) <xCT.lua:1872,1891> (70 instructions, 280 bytes at 0x107b0f030)
    [1877]  GETGLOBAL   3 -3    ; time
    [1885]  GETGLOBAL   9 -13   ; xCTdone
    [1885]  GETGLOBAL   12 -16  ; unpack
dmg = function(self, event, ...)    <xCT.lua:1919,2137> (625 instructions, 2500 bytes at 0x107b0f3b0)
    [1920]  GETGLOBAL   4 -2    ; xCTdone
    [1922]  GETGLOBAL   16 -5   ; UnitGUID
    [1930]  GETGLOBAL   24 -12  ; xCTcrit
    [1937]  GETGLOBAL   4 -2    ; xCTdone
    [1945]  GETGLOBAL   25 -5   ; UnitGUID
    [1946]  GETGLOBAL   24 -21  ; PET_ATTACK_TEXTURE
    [1964]  GETGLOBAL   28 -12  ; xCTcrit
    [1980]  GETGLOBAL   4 -2    ; xCTdone
    [2002]  GETGLOBAL   30 -12  ; xCTcrit
    [2018]  GETGLOBAL   4 -2    ; xCTdone
    [2059]  GETGLOBAL   18 -47  ; string
    [2059]  GETGLOBAL   19 -47  ; string
    [2059]  GETGLOBAL   20 -49  ; IMMUNE
    [2070]  GETGLOBAL   19 -5   ; UnitGUID
    [2071]  GETGLOBAL   18 -21  ; PET_ATTACK_TEXTURE
    [2077]  GETGLOBAL   18 -2   ; xCTdone
    [2083]  GETGLOBAL   21 -47  ; string
    [2083]  GETGLOBAL   22 -47  ; string
    [2083]  GETGLOBAL   23 -49  ; IMMUNE
    [2095]  GETGLOBAL   21 -2   ; xCTdone
    [2108]  GETGLOBAL   24 -57  ; xCTgen
    [2108]  GETGLOBAL   26 -58  ; ACTION_SPELL_DISPEL
    [2116]  GETGLOBAL   22 -57  ; xCTgen
    [2116]  GETGLOBAL   24 -62  ; ACTION_SPELL_INTERRUPT
    [2124]  GETGLOBAL   22 -57  ; xCTgen
    [2124]  GETGLOBAL   24 -65  ; ACTION_SPELL_STOLEN
    [2128]  GETGLOBAL   17 -69  ; ACTION_PARTY_KILL
    [2128]  GETGLOBAL   18 -69  ; ACTION_PARTY_KILL
    [2131]  GETGLOBAL   21 -74  ; GetPlayerInfoByGUID
    [2132]  GETGLOBAL   20 -75  ; RAID_CLASS_COLORS
    [2134]  GETGLOBAL   19 -57  ; xCTgen
heal = function(self, event, ...)   <xCT.lua:2153,2214> (168 instructions, 672 bytes at 0x107b10770)
    [2154]  GETGLOBAL   4 -2    ; xCTdone
    [2156]  GETGLOBAL   16 -5   ; gflags
    [2171]  GETGLOBAL   27 -18  ; xCTcrit
    [2186]  GETGLOBAL   4 -2    ; xCTdone
function loadstacktracker() <xCT.lua:2221,2266> (26 instructions, 104 bytes at 0x107b10b50)
    [2223]  GETGLOBAL   0 -2    ; xCTclass
    [2224]  GETGLOBAL   0 -5    ; unpack
    [2224]  GETGLOBAL   1 -6    ; select
    [2224]  GETGLOBAL   2 -7    ; time
    [2225]  GETGLOBAL   3 -8    ; CreateFrame
track = function(self, event, unit) <xCT.lua:2227,2260> (100 instructions, 400 bytes at 0x107b10fc0)
    [2232]  GETGLOBAL   4 -4    ; UnitBuff
    [2239]  GETGLOBAL   15 -4   ; UnitBuff
    [2243]  GETGLOBAL   15 -8   ; xCTclass
    [2249]  GETGLOBAL   15 -8   ; xCTclass
    [2254]  GETGLOBAL   3 -15   ; UnitExists
    [2256]  GETGLOBAL   3 -8    ; xCTclass
function ct:UpdateComboPoints() <xCT.lua:2268,2289> (59 instructions, 236 bytes at 0x107b11140)
    [2269]  GETGLOBAL   1 -1    ; GetComboPoints
    [2273]  GETGLOBAL   5 -7    ; MAX_COMBO_POINTS
    [2280]  GETGLOBAL   5 -9    ; xCTclass
    [2280]  GETGLOBAL   7 -11   ; tostring
    [2283]  GETGLOBAL   5 -14   ; xCTgen
    [2283]  GETGLOBAL   7 -15   ; format
    [2283]  GETGLOBAL   8 -16   ; COMBAT_TEXT_COMBO_POINTS
    [2287]  GETGLOBAL   5 -9    ; xCTclass
[Finished in 0.1s]
ckaotik commented 12 years ago

If you're interested in the findglobals script, you can find it here: http://www.wowace.com/addons/findglobals/

dandruff commented 12 years ago

Very epic! I saw that not too long ago, but ever got a chance to run it! I'll look into patching those leaks

dandruff commented 12 years ago

For reference later, these seem to be the big ones.

tonumber select string _G time print abs floor math unpack type format


lowHealth lowMana [1161] arg1 [2221][228] loadstacktracker [1559] f [1586] collectgarbage [1645] _ [2156] gflags

ckaotik commented 11 years ago

I ran the script again against xCT+ beta 5 with the following results (I excluded obvious globals, such as LibStub and API calls):

function X:OnInitialize()   <core.lua:25,53>
    [26]    GETGLOBAL   1 -2    ; ct        -- this is not used later on and doesn't seem initialized?
    [26]    GETGLOBAL   1 -2    ; ct
    [26]    GETGLOBAL   1 -2    ; ct
function ItemToggleAll(info)    <core.lua:113,118>
    [115]   GETGLOBAL   3 -2    ; self      -- these should be X.db.<things> instead of self.db.<things>
    [116]   GETGLOBAL   6 -2    ; self

These seem to be the only issues, yay!

dandruff commented 11 years ago

Oh right, "ct" is a global that gets leaked in Affli's version of xCT as per 1.9f? I have it there in case it's defined, I stop loading the addon. (To prevent confusion with other addons, I perform two more checks to make sure I know what it is).