[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weird workaround necessary for mescc-lib on ARM
From: |
Danny Milosavljevic |
Subject: |
Re: Weird workaround necessary for mescc-lib on ARM |
Date: |
Sun, 14 Jun 2020 17:33:51 +0200 |
> Could it be that ungetc tries to unget EOF? In that case the man page
> of ungetc says that it will cast it to unsigned char (and thus it will
> actually unget 255).
It's actually reaching this point:
int
unreadchar (int c)
{
if (__stdin >= 0)
return fdungetc (c, __stdin);
<------ here, with c == -1
SCM port = current_input_port ();
SCM string = STRING (port);
size_t length = LENGTH (string);
char *p = CSTRING (string);
p--;
string = make_string (p, length + 1);
p = CSTRING (string);
p[0] = c;
STRING (port) = string;
return c;
}
(gdb) bt
#0 unreadchar (c=-1) at src/posix.c:82
#1 0x00020d98 in reader_read_identifier_or_number (c=-1) at src/reader.c:107
#2 0x00021034 in reader_read_sexp_ (c=109, a=1) at src/reader.c:155
#3 0x0002122c in read_env (a=1) at src/reader.c:192
#4 0x00020a70 in read_input_file_env (a=9001) at src/reader.c:43
#5 0x0001ac18 in eval_apply () at src/mes.c:1120
#6 0x0001eab0 in main (argc=31, argv=0xbefff004) at src/mes.c:1871
pgpFu7FODphzl.pgp
Description: OpenPGP digital signature