View Single Post
09-26-13, 04:46 PM   #18
Foxlit
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 91
Originally Posted by Belechannas View Post
So I have to ask, Foxlit - how did you determine that line to be the problem?
What actually worked was this: prevent large chunks of nUI's code from running, check if issue still persists, repeat with a different or smaller chunk. Upon narrowing to nUI/Bars/nUI_MicroMenu.lua, read the code to find that it replaces SetPoint on all microbuttons, while UpdateMicroButtons(), which eventually calls MainMenuMicroButton:SetPoint (because of the in-game store in 5.4.0), is called from the execution path that eventually taints TalentUI. Comment out the SetPoint assignment, verify that TalentUI is no longer tainted and that glyphs/talents can be removed.

I actually started by looking at the error message, then the relevant static popup's OnAccept handler, verified that PlayerTalentFrame.talentGroup was tainted (issecurevariable is your friend), then backtracked through TalentUI code to figure out approximately where nUI taints TalentUI -- issecurevariable suggested it was somewhere after PlayerTalentFrameTalents.summariesShownWhenNoPrimary = true in PlayerTalentFrame_OnShow, and before the PlayerTalentFrame.selectedPlayerSpec = self.specIndex in PlayerSpecTab_OnClick. Upon closer examination, this made no sense (there's nothing you could taint by accident between those two points), so off I went to do what was described in the first paragraph.

Bonus observation: taint tracking doesn't work properly. In this case, TalentUI was tainted through the UpdateMicroButtons call in PlayerTalentFrame_OnShow, so PlayerTalentFrameTalents.summariesShownWhenNoPrimary, which is set immediately after the UpdateMicroButtons call, should've also been tainted, and yet issecurevariable claims that it wasn't. You can also test this by doing /run UpdateMicroButtons = function() print("Hi!") end, opening the talent frame, and observing that /dump issecurevariable(PlayerTalentFrameTalents, "summariesShownWhenNoPrimary") prints 1. This one is in our favour (something that should be tainted isn't), but broke my debug-by-reading approach.
__________________
... and you do get used to it, after a while.