* bug#7244: `characterp' signals overflow-error
@ 2010-10-19 0:23 MON KEY
2010-10-19 2:47 ` Kenichi Handa
0 siblings, 1 reply; 5+ messages in thread
From: MON KEY @ 2010-10-19 0:23 UTC (permalink / raw)
To: 7244
(characterp 2536870911) signals overflow-error "2536870911")
;=> Debugger entered--Lisp error: (overflow-error "2536870911")
Why should this happen esp. when `max-char' sits just below the definition in
src/character.c ??
--
/s_P\
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#7244: `characterp' signals overflow-error
2010-10-19 0:23 bug#7244: `characterp' signals overflow-error MON KEY
@ 2010-10-19 2:47 ` Kenichi Handa
2010-10-20 15:15 ` MON KEY
0 siblings, 1 reply; 5+ messages in thread
From: Kenichi Handa @ 2010-10-19 2:47 UTC (permalink / raw)
To: MON KEY; +Cc: 7244
In article <AANLkTinNtQyW9XQrC56RE0ZqKEsC2B=SQDZT=QX2mLoD@mail.gmail.com>, MON KEY <monkey@sandpframing.com> writes:
> (characterp 2536870911) signals overflow-error "2536870911")
> ;=> Debugger entered--Lisp error: (overflow-error "2536870911")
> Why should this happen esp. when `max-char' sits just below the definition in
> src/character.c ??
The error is signaled by Lisp reader; i.e. before characterp
is executed.
---
Kenichi Handa
handa@m17n.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#7244: `characterp' signals overflow-error
2010-10-19 2:47 ` Kenichi Handa
@ 2010-10-20 15:15 ` MON KEY
2010-10-20 16:56 ` Lawrence Mitchell
2010-10-21 2:26 ` Kenichi Handa
0 siblings, 2 replies; 5+ messages in thread
From: MON KEY @ 2010-10-20 15:15 UTC (permalink / raw)
To: Kenichi Handa; +Cc: 7244
On Mon, Oct 18, 2010 at 10:47 PM, Kenichi Handa <handa@m17n.org> wrote:
> In article <AANLkTinNtQyW9XQrC56RE0ZqKEsC2B=SQDZT=QX2mLoD@mail.gmail.com>, MON KEY <monkey@sandpframing.com> writes:
>
>> (characterp 2536870911) signals overflow-error "2536870911")
>> ;=> Debugger entered--Lisp error: (overflow-error "2536870911")
>
>> Why should this happen esp. when `max-char' sits just below the definition in
>> src/character.c ??
>
> The error is signaled by Lisp reader; i.e. before characterp
> is executed.
OK. I didn't realize this.
This said, I am not understanding _where_ the overflow boundary is,
e.g. following doesn't signal:
most-positive-fixnum
;=> 536870911 (#o3777777777, #x1fffffff)
(characterp 536870913)
;=> nil
> Kenichi Handa
--
/s_P\
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#7244: `characterp' signals overflow-error
2010-10-20 15:15 ` MON KEY
@ 2010-10-20 16:56 ` Lawrence Mitchell
2010-10-21 2:26 ` Kenichi Handa
1 sibling, 0 replies; 5+ messages in thread
From: Lawrence Mitchell @ 2010-10-20 16:56 UTC (permalink / raw)
To: bug-gnu-emacs
MON KEY wrote:
> On Mon, Oct 18, 2010 at 10:47 PM, Kenichi Handa <handa@m17n.org> wrote:
>> In article <AANLkTinNtQyW9XQrC56RE0ZqKEsC2B=SQDZT=QX2mLoD@mail.gmail.com>, MON KEY <monkey@sandpframing.com> writes:
>>> (characterp 2536870911) signals overflow-error "2536870911")
>>> ;=> Debugger entered--Lisp error: (overflow-error "2536870911")
>>> Why should this happen esp. when `max-char' sits just below the definition in
>>> src/character.c ??
>> The error is signaled by Lisp reader; i.e. before characterp
>> is executed.
> OK. I didn't realize this.
> This said, I am not understanding _where_ the overflow boundary is,
> e.g. following doesn't signal:
> most-positive-fixnum
> ;=> 536870911 (#o3777777777, #x1fffffff)
> (characterp 536870913)
> ;=> nil
Fread does this:
EMACS_INT n = (errno = 0, strtol (read_buffer, &endptr, 10));
So if the number to be read does not fit in a long int, then
you'll get a range error in strtol which is where the overflow
comes from.
For you, most-positive-fixnum == 2^29 - 1, so LONG_MAX == 2^31 -
1 (2147483647). 2536870911 > 2147483647. So you get a
range error when trying to convert the number with strtol.
Lawrence
--
Lawrence Mitchell <wence@gmx.li>
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#7244: `characterp' signals overflow-error
2010-10-20 15:15 ` MON KEY
2010-10-20 16:56 ` Lawrence Mitchell
@ 2010-10-21 2:26 ` Kenichi Handa
1 sibling, 0 replies; 5+ messages in thread
From: Kenichi Handa @ 2010-10-21 2:26 UTC (permalink / raw)
To: MON KEY; +Cc: 7244
In article <AANLkTikH0Uv3R1W4BmDzPtS-3EaKtCjHPpK2nvP8wrcM@mail.gmail.com>, MON KEY <monkey@sandpframing.com> writes:
> OK. I didn't realize this.
> This said, I am not understanding _where_ the overflow boundary is,
> e.g. following doesn't signal:
> most-positive-fixnum
> ;=> 536870911 (#o3777777777, #x1fffffff)
> (characterp 536870913)
> ;=> nil
Lisp reader reads "536870913" as a float.
(type-of 536870913) => float
---
Kenichi Handa
handa@m17n.org
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-10-21 2:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 0:23 bug#7244: `characterp' signals overflow-error MON KEY
2010-10-19 2:47 ` Kenichi Handa
2010-10-20 15:15 ` MON KEY
2010-10-20 16:56 ` Lawrence Mitchell
2010-10-21 2:26 ` Kenichi Handa
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).