Skip to content

Instantly share code, notes, and snippets.

@KeenS
Created May 31, 2015 10:48
Show Gist options
  • Save KeenS/87c8c2c4d36eb8276e01 to your computer and use it in GitHub Desktop.
Save KeenS/87c8c2c4d36eb8276e01 to your computer and use it in GitHub Desktop.

場所

load_piclibでSRFI17を読む時に問題が発生します。

(prefix (only (scheme base) set!) %)を処理する時にプリフィックスとして %を結合します。 結合の時にopen_output_stringを呼びます。それは内部でstring_open(pic, NULL, 0)を呼びますが 第二引数(data)にNULLを渡しているにも関らずif (data != NULL) がthen clauseに飛びます。

load_piclib.c:1882
  pic_load_cstr(pic, &piclib_src_contrib_10_srfi_srfi_17[0][0]);
...
lib.c:94
  pic_format(pic, "~s~s", prefix, pic_obj_value(sym))
...
string.c::414
  port = pic_open_output_string(pic);
...
port.c:170
   port->file = string_open(pic, NULL, 0);
port.c:138
  if (data != NULL) {

環境

gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Linux Dynabook 3.19.0-20-generic #20-Ubuntu SMP Fri May 29 10:10:47 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

備考

-O2フラグを付与した時に発生。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment