summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-02-07 17:18:03 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2016-02-07 17:18:03 (GMT)
commitcfe11cf038febc8262f91d43f370c824f55913b6 (patch)
tree33d9a0321d08fc32caa8ec68e5e023884cc5e347
parente619a76bef4c207a015834e1644ccfd9d6aea761 (diff)
downloadnsgenbind-cfe11cf038febc8262f91d43f370c824f55913b6.tar.gz
nsgenbind-cfe11cf038febc8262f91d43f370c824f55913b6.tar.bz2
ensure webidl intercalate copes with empty webidl
-rw-r--r--src/webidl-ast.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/webidl-ast.c b/src/webidl-ast.c
index 26851c3..0d908ce 100644
--- a/src/webidl-ast.c
+++ b/src/webidl-ast.c
@@ -672,16 +672,20 @@ intercalate_implements(struct webidl_node *interface_node, void *ctx)
/* exported interface defined in webidl-ast.h */
int webidl_intercalate_implements(struct webidl_node *webidl_ast)
{
- /* for each interface:
- * for each implements entry:
- * find interface from implemets
- * recusrse into that interface
- * copy the interface into this one
- */
- return webidl_node_for_each_type(webidl_ast,
- WEBIDL_NODE_TYPE_INTERFACE,
- intercalate_implements,
- webidl_ast);
+ int res = 0;
+ if (webidl_ast != NULL) {
+ /* for each interface:
+ * for each implements entry:
+ * find interface from implemets
+ * recusrse into that interface
+ * copy the interface into this one
+ */
+ res = webidl_node_for_each_type(webidl_ast,
+ WEBIDL_NODE_TYPE_INTERFACE,
+ intercalate_implements,
+ webidl_ast);
+ }
+ return res;
}
/* exported interface defined in webidl-ast.h */