From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Some issues with the tree-sitter branch Date: Mon, 17 Oct 2022 13:37:39 +0800 Message-ID: <878rlfko2k.fsf@yahoo.com> References: <83o7ub51yd.fsf@gnu.org> <6F240F48-E29C-4E75-B5D5-30C7CF7956C9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18291"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 17 07:47:47 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1okIyY-0004YZ-SX for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Oct 2022 07:47:46 +0200 Original-Received: from localhost ([::1]:48832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okIyW-0002iT-Pa for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Oct 2022 01:47:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okIp1-000820-J6 for emacs-devel@gnu.org; Mon, 17 Oct 2022 01:37:57 -0400 Original-Received: from sonic313-10.consmr.mail.ne1.yahoo.com ([66.163.185.33]:34550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okIoz-0000bs-Lq for emacs-devel@gnu.org; Mon, 17 Oct 2022 01:37:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1665985070; bh=sfEQuy5ev3KpBEz65rxjFQ5IIftpgJ7OHxSotUyb57c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=lHZWTI/OhS+xSqt8ygK4omnW6VZPmwA9X9xZ7D50ntsUcs7N8pHJ7MoohUdYYITJ+TJg6AnNnj438sa9Mt/Crhz54VP9oC8JAAdqxR7KXm/tGdOvxsD/2Xa+WT8ghWOAgdMiZis5qGe3BQU45ix3BNBLGpX5EwMGDZOx1WMJOrspbd7NeWbeJ20tLZ8RvrHQg7FznLEj3u8PbjyCe6MhFUUosd3ZTHHLOSXcjZNMDTYySraImk/iwuh415AuWtjcA+XiAngKBEFg50pvHTo8PlFZFZEpYB6OORw2SiyMCETkYC8x14Mf9w8CwwoW4fc+ONRAhwEISSmWngdv0CnGYA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1665985070; bh=lFRoImyq9gm/dvQnLOifIihtC4sChiCfzA4jKnqwlHX=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=bN4UQZa4FlINPC1sp9lnIYOp5MqrXDGHApWe8t08NbzIlWBOd3N3nnRiXgFAfL4QCB6L38w0ZnLGB2E6r0qkCzmI3EymZ0clV9AdQY0hbforFsnjEUXBtFQsxM5MJaK6S2V0NGXg1vfmot2CQS908fS5tJXo8v05hixkHNgyUw9hvIg5x3A1RtixELaHPM86cvIXvQbHvpvPfnLCu2af1TbTtwx+F+Cm/DAK6gw3svjVm4I7RjIDCS54qO10PP1w0gaVjiEgGbmI/03I3ct/VVsoPeDzn6TFBEC7HK7EDOHhEY7Wa7WnWI88iuEztIzUup6KxjHuEZ7jyXUIBQ2osA== X-YMail-OSG: WNpsR4gVM1nn3rCAV_pxrRVBMyXXH5.NeUHDXH94rahpgVFV4y04hSmWvW66a28 x7oU8YzE33PfLq3oxzOcHXZ.EnYDVo6DItfJYOnuYvMuqXcpNcaZZgKsNW4c1KCDYvo9TKBAxioO rmivJuD97lLvrPD32BSiov0NWpCH9MB.NQFZU6h1OKmRn_BkBFtALEiIBzXONB7OxGKvW_dS7x.w hecaKm8OUuAe2QoyfxxQSTVKOOksgxzGSvWQd32bI5HmZ4NyyZKtmgUVSlH69vPHGNhaQ_Vn9E3o n5NRZkgXhtCeAi_FVD6wMVvAOBnWrNat8_ScJsfPpGDBxHH4cakCcy4AOQ1DiV1B3owjpQRVkoOj HB_xNO2V6Iyv8exoVtGQafaBhq8O9QyKzU1UTY8HnWDYmn6tZLk18hjb8JdGlXlASalOa.Y.8n2G rlDypbrbwToBHvv0ft0C.iNDqsN5Q_k2fNvvDc3KxydtQJ3GPZShdx2KtXkQPMLEw2XeZp3P9t8D a6ZZ0wcb1d5LTtTiTk9KoHWF64ePNX6qKfZvKCGYuh6McYGvLl85tOTOLq1TN8iRNoZ.NRmPxuo8 lvaMs.dCOB2AKKAi_3nNjlOorb7zFBtPfCMVpcXjeqYMcD2knO9c4cbhnukYtXgFQjvpPJG_n0Y9 7HJIxHpGAfVXA6x6fcUgnrR1L0R9.xfASS.l4helmqdNz9_d1sJ_xA913g2uy0yHhQ8BT40TxggY .KtVHZmo38CawWRGB.V0NX89T21b6Il76EPUgGsKAr2fHtIq_m_N8GDCd1NcKmU_PcnweglJF3x6 wchMUItP_kEVQ68iHXbW0XrreXXpz55N_3dtemzdKF X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Mon, 17 Oct 2022 05:37:50 +0000 Original-Received: by hermes--production-sg3-785466d859-4mnw4 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 85c766c13646929408c808b9d489512c; Mon, 17 Oct 2022 05:37:44 +0000 (UTC) In-Reply-To: <6F240F48-E29C-4E75-B5D5-30C7CF7956C9@gmail.com> (Yuan Fu's message of "Sun, 16 Oct 2022 21:53:06 -0700") X-Mailer: WebService/1.1.20740 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.185.33; envelope-from=luangruo@yahoo.com; helo=sonic313-10.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297911 Archived-At: Yuan Fu writes: > I think you meant the lack of a range check? Like mentioned here: > > + /* FIXME: We should signal an error below if START_BYTE > + etc. overflow the 32-bit unsigned data type. */ > > I added buffer size check at parser creation time, and used casts to > uint32_t liberally, assuming the values never overflows and, so we > don=E2=80=99t need to handle the error at a million places. But I should = have > added checks in ts_after_chang and other places where buffer size > could change. I=E2=80=99ll add checks in ts_after_change and other places= , and > if the argumetns overflows uint32, it will set a flag (say, > buffer_too_large) in the parser object, and next time any lisp > function tries to use that parser, an buffer-too-large error will be > signaled. WDYT? Isn't there a way to make tree-sitter parse buffers larger than uint32_t? AFAIK, our buffers can be EMACS_INT large (especially with long log files), and tree-sitter should be fast enough to parse them incrementally?