Closed Bug 429534 Opened 16 years ago Closed 16 years ago

Treehydra: objects with null tree code appearing in dehydra-types conversions

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dmandelin, Assigned: taras.mozilla)

References

Details

This bug applies to the dehydra_types library, which is JS that converts Treehydra types to Dehydra types. We're currently getting a JS exception in running static-analysis.js in Treehydra on nsArrayEnumerator.cpp from mozilla-central as of 16 April. This is using Treehydra as of 16 April, changeset af819f44b59a (adding instrumentation). The immediate cause of the exception is a Treehydra object with TREE_CODE (.base.code) of null, which causes failures in many treehydra.js lib functions. These null values are very surprising, so it really needs to be figured out.
You are getting a null because types aren't always tree_nodes :) It's probably a lang_tree_node. Types can have language-specific stuff in them. GCC does weird things with the tree_code stuff, so I haven't yet made treehydra support C++-specific tree codes. One should probably fix convert_tree.js to output an integer when an enum can not be produced. That'd be much easier to diagnose.
I think it is a tree node, but I definitely agree that those nulls are very bad. Beyond debuggability, the library code can't handle them. I changed the code generator so it returns a dummy Treehydra enum and prints a warning that includes the real name of the tree code. It turns out all the nodes causing problems for the test case here are TEMPLATE_DECLs.
They are indeed tree nodes. TEMPLATE_DECL afaik is not defined in the middleend by default :) I'd be against returning bogus nodes and would rather have code fail when it hits funny enums. For now you can use cp_tree_code type instead of tree_code. We'll have to figure out how to separate C stuff from C++ later.
Adding this to my queue
Status: NEW → ASSIGNED
Assignee: dmandelin → tglek
Status: ASSIGNED → NEW
same fix as for 427661
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.