| ... | ... | @@ -109,6 +109,7 @@ static AstNode *create_var_decl_node(Context *c, const char *var_name, AstNode * |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static AstNode *create_prefix_node(Context *c, PrefixOp op, AstNode *child_node) { |
| 112 | assert(child_node); |
| 112 | 113 | AstNode *node = create_node(c, NodeTypePrefixOpExpr); |
| 113 | 114 | node->data.prefix_op_expr.prefix_op = op; |
| 114 | 115 | node->data.prefix_op_expr.primary_expr = child_node; |
| ... | ... | @@ -195,9 +196,7 @@ static AstNode *convert_to_c_void(Context *c, AstNode *type_node) { |
| 195 | 196 | } |
| 196 | 197 | |
| 197 | 198 | static AstNode *pointer_to_type(Context *c, AstNode *type_node, bool is_const) { |
| 198 | | if (!type_node) { |
| 199 | | return nullptr; |
| 200 | | } |
| 199 | assert(type_node); |
| 201 | 200 | PrefixOp op = is_const ? PrefixOpConstAddressOf : PrefixOpAddressOf; |
| 202 | 201 | AstNode *child_node = create_prefix_node(c, op, convert_to_c_void(c, type_node)); |
| 203 | 202 | return create_prefix_node(c, PrefixOpMaybe, child_node); |
| ... | ... | @@ -278,6 +277,9 @@ static AstNode *make_type_node(Context *c, const Type *ty, const Decl *decl, |
| 278 | 277 | const PointerType *pointer_ty = static_cast<const PointerType*>(ty); |
| 279 | 278 | QualType child_qt = pointer_ty->getPointeeType(); |
| 280 | 279 | AstNode *type_node = make_qual_type_node(c, child_qt, decl); |
| 280 | if (!type_node) { |
| 281 | return nullptr; |
| 282 | } |
| 281 | 283 | if (child_qt.getTypePtr()->getTypeClass() == Type::Paren) { |
| 282 | 284 | const ParenType *paren_type = static_cast<const ParenType *>(child_qt.getTypePtr()); |
| 283 | 285 | if (paren_type->getInnerType()->getTypeClass() == Type::FunctionProto) { |