From patchwork Thu Aug 10 21:02:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Li X-Patchwork-Id: 9894589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 864E1603B4 for ; Thu, 10 Aug 2017 21:02:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 783D128B4D for ; Thu, 10 Aug 2017 21:02:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CB2E28BA1; Thu, 10 Aug 2017 21:02:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8125C28BA0 for ; Thu, 10 Aug 2017 21:02:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752942AbdHJVCF (ORCPT ); Thu, 10 Aug 2017 17:02:05 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:37998 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752816AbdHJVCF (ORCPT ); Thu, 10 Aug 2017 17:02:05 -0400 Received: by mail-yw0-f196.google.com with SMTP id p68so1170044ywg.5 for ; Thu, 10 Aug 2017 14:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=xbDvw6iqvvSYQdqfQmJiMvLWe3BxfgcHxib/twGNWnE=; b=J2gq1IR0PrBexCxWECkoauW/tSNz/h0mzvnFAgof850SpCRDM+Gr6lEKNwIYBJfmGb k0PD4Gk/SG0DQSyP6ceC1ZRN6AD3rIn4XbKlSxJmiwT9PwwEQuJMRqd/M84rvgiEvPer fZE6jp1wZstU/aKHUyrTRLe6RYa2Dk7v3lUqPx+qwBHWF/8E6+z90nrYw/sSudRvy+/K PjR8BGMBc5PzgE2TECykFUkoSLlhdVIHuL4y74kIy0BsgT4rfqr5cgGvcMDCa6uZsqTJ F+6BpJiNV3lynAWQVKQWu67w6x0ca9xlxeEPWNpIy5vg7oIAU1adhKZeFi/5dd18ntrK tUEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:cc; bh=xbDvw6iqvvSYQdqfQmJiMvLWe3BxfgcHxib/twGNWnE=; b=pb/Z7R/76ck1lqO+CUQPFhXnUoabcagH9LwWHBxld0dg3MWC08RxwPvZMEkert+tSi MBC706W4wW/ZoPZQlYmA1WM/98jJLNzWmBKZtiEoJg/z87Qvm9d1i1IXVreyRk5ybX2L EWfxOOgUXaO0Y52tXaIrVeroqA0l7w7NkCjp0NOIByuJcvgjOp5Ahe8hAGApkKV/CeeS Lk9dBR6TJFPr7DrAPYwzzY124jUziWAs7DcuDGWOw/nV+/ennOsF27DWb1rHUAN0Qa5M 4enUn4D2pvc9XPTZ74v3oA7Fb/ed55lIb4zEy49oeMz7qyHN2943XN8be9zjao4K40rE jN/g== X-Gm-Message-State: AHYfb5gS09wRRIo81zseZeuxAjBWwWAW0A0B7+AkuHCoxUO2DFnBFtZ2 ICjVwJ1KiaK8cPUGP45m18DMTOtysAr1 X-Received: by 10.129.229.4 with SMTP id s4mr10568552ywl.130.1502398923481; Thu, 10 Aug 2017 14:02:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.68.39 with HTTP; Thu, 10 Aug 2017 14:02:03 -0700 (PDT) From: Christopher Li Date: Thu, 10 Aug 2017 17:02:03 -0400 X-Google-Sender-Auth: XBd_qmLVBEkg6jj8Urd5jHTG7-o Message-ID: Subject: [PATCH 1/2] test-inspect: handle special case iter==NULL To: Linux-Sparse Cc: Luc Van Oostenryck , Dibyendu Majumdar Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP GtkTreeView has this special case that iter==NULL means the root node. Reported-by: Dibyendu Majumdar Signed-off-by: Christopher Li --- ast-model.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ast-model.c b/ast-model.c index 63d2762..cbd82db 100644 --- a/ast-model.c +++ b/ast-model.c @@ -401,7 +401,8 @@ static gint ast_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter) { - AstNode *node = iter->user_data; + AstNode *node = iter ? iter->user_data + : AST_NODE(tree_model); inspect_child_node(node); return node->childnodes->len;