From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by sourceware.org (Postfix) with ESMTPS id 5F099384240D for ; Fri, 3 Jul 2020 14:05:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5F099384240D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wm1-f65.google.com with SMTP id o2so34194837wmh.2 for ; Fri, 03 Jul 2020 07:05:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/ZVUzFQ5XWt1EdCDUUnsyOk0CUCT8M+Ykbzz502/v6Y=; b=TNE2XONrg2afKR4IfXrdqFFYqLBTYu/wkYmlhk3ZFF5eIBHbksJYh8RA/SYJdakaac Mb89LQQ+bd2QfQ0wEkiEbCyOtQlPKYI6cFWmrsZMo3WFMhAg90AN/HyC4WpDaZBe5vLB Kad/DFdnKgIxMLv+EQccltgs2LrA0xTdMk92SfS7xh7q9izWixyt45OBsPcOGGaIxRxx lPds2CNO7LBb/JnvX+V6VHs0sWLN5kulm7Fo9jtHL6uJxd+FMtloAfeD5AF6eQpjc6TD 7FLMYomacV2JiVzyRmEhlj0QOPB1VL5EGSSx5XGfL7AIhbTRDeQfo1Qwv8DriJO7+YWW zPvw== X-Gm-Message-State: AOAM5317fwud22H7whQW4CGrnbmEz6lnFK2CnA2tvU/C3/VZI6J4bLo9 hQ0xFv5vj+A8intzisBh5JnW9edrCfc= X-Google-Smtp-Source: ABdhPJzkoIqCvpcDttqUPGfAm6n5msaHSlphCc+Aww0y0Rp+1mW6egoDKKB6f8U8aVLf9/gXP5KYHg== X-Received: by 2002:a1c:1fd1:: with SMTP id f200mr35807035wmf.162.1593785136005; Fri, 03 Jul 2020 07:05:36 -0700 (PDT) Received: from ?IPv6:2001:8a0:f922:c400:56ee:75ff:fe8d:232b? ([2001:8a0:f922:c400:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id z16sm14047412wrr.35.2020.07.03.07.05.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Jul 2020 07:05:33 -0700 (PDT) Subject: Re: [PATCH] Make out of range type conversions explicit To: Gary Benson References: <1593525480-5685-1-git-send-email-gbenson@redhat.com> <20200703093018.GB8482@blade.nx> <70597daf-9f55-fff8-6503-7602c204028a@palves.net> <20200703130945.GA16144@blade.nx> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Fri, 3 Jul 2020 15:05:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200703130945.GA16144@blade.nx> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2020 14:05:38 -0000 On 7/3/20 2:09 PM, Gary Benson wrote: > Pedro Alves wrote: >> On 7/3/20 10:30 AM, Gary Benson wrote: >>> Pedro Alves wrote: >>>> diff --git a/gdb/testsuite/gdb.base/structs2.c b/gdb/testsuite/gdb.base/structs2.c >>>> index 7c8be035221..aac7bce8c15 100644 >>>> --- a/gdb/testsuite/gdb.base/structs2.c >>>> +++ b/gdb/testsuite/gdb.base/structs2.c >>>> @@ -13,7 +13,7 @@ main () >>>> >>>> bkpt = 0; >>>> param_reg (120, 130, 32000, 33000); >>>> - param_reg (130, 120, 33000, 32000); >>>> + param_reg (-120, 130, -32000, 33000); >>>> >>>> return 0; >>>> } >>> >>> On first glance I thought this was a copy-paste error. I don't >>> think it is, but, just in case, can you confirm the change above >>> is what you intended? >> >> What do you mean by "this"? If you mean, the proposed change >> instead of: >> >> param_reg (120, 130, 32000, 33000); >> - param_reg (130, 120, 33000, 32000); >> + param_reg (-130, 120, -33000, 32000); >> >> It's just that -130 and -33000 overflows, so I swapped the >> numbers back. > > Cool, thank you. > I've merged both patches. Thanks, Pedro Alves