View Single Post
10-23-12, 10:02 AM   #3
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
Originally Posted by SDPhantom View Post
The default UI tends to taint itself a lot. When taint happens, the game engine always assumes it's from an addon and only stores an index number to tell which one. I don't know the game engine's code, but let's say when the default UI taints itself, this index gets set to 0. When the game gets to displaying an error about it, there is no addon at index 0, so to prevent a crash, it picks index 1, which is the top addon in the addon list when you look at it in the character select screen.
That's not how it work, the default UI cannot taint itself. This is how taint works:

Blizzards code is blessed and carries no taint, this includes the AddOns/Blizzard_*. Addons (eg, everything else) start out as tainted. Every time an addon touches something that's untainted (Blizzard code), the part of Blizzards code you touched becomes tainted. Blizzard does not notify you about taint until it hits something that requires an untainted execution path, such as :Show() or :Hide() while in combat. Or the glyph/talent UI.

The secure templates are a mix of this. They are blessed/untainted because it's Blizzard code, but they become tainted because addons interact with them. They can temporarily ignore taint when executing, because the secure templates have a strict environment and verifies everything to make sure no monkey business is going on.

You can see this if you look at the code, such as SecureTemplates.lua which calls forceinsecure() to force taint when it's calling a custom method that's not controlled by the secure templates.

As an analogy, because everyone loves analogies: Blizzards code is blue, Addons are red. Whenever an addon (red) interacts with blizzards code (blue), Blizzards code turns red. Everything will continue executing merrily along it's way until the C engine reaches a point where it has to go "Only execute this if it's still blue, otherwise raise a taint error".

This is also how taint can spread. Because once you taint one part of the Blizzard code, it can spread to other areas if tainted Blizzard code interacts with other tainted code.

Last edited by Shadowed : 10-23-12 at 10:13 AM.
  Reply With Quote