[uim-commit] r2881 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Tue Jan 10 04:16:41 PST 2006


Author: yamaken
Date: 2006-01-10 04:16:37 -0800 (Tue, 10 Jan 2006)
New Revision: 2881

Modified:
   branches/r5rs/sigscheme/config.h
   branches/r5rs/sigscheme/operations.c
Log:
* sigscheme/operations.c
  - (scm_p_string2list): Add a comment about SCM_USE_NULL_CAPABLE_STRING
* sigscheme/config.h
  - Error if SCM_USE_NULL_CAPABLE_STRING is enabled when !SCM_DEBUG


Modified: branches/r5rs/sigscheme/config.h
===================================================================
--- branches/r5rs/sigscheme/config.h	2006-01-10 11:51:22 UTC (rev 2880)
+++ branches/r5rs/sigscheme/config.h	2006-01-10 12:16:37 UTC (rev 2881)
@@ -82,7 +82,7 @@
 #define SCM_ACCESSOR_ASSERT     0  /* enable strict type check with accessor */
 #define SCM_USE_VALUECONS       1  /* use experimental values passing */
 #define SCM_VOLATILE_OUTPUT     0  /* always flush files on write */
-#define SCM_USE_NULL_CAPABLE_STRING 1  /* accept null character in a middle of a string */
+#define SCM_USE_NULL_CAPABLE_STRING 1  /* enable experimental null character in a middle of a string */
 #define SCM_OBJ_COMPACT         0  /* object representation compaction (experimental) */
 
 #define SCM_GCC4_READY_GC       1  /* use experimental gcc4-ready stack protection */
@@ -140,6 +140,10 @@
 #error "This platform is not supported yet"
 #endif
 
+#if (!SCM_DEBUG && SCM_USE_NULL_CAPABLE_STRING)
+#error "Don't enable dangerous SCM_USE_NULL_CAPABLE_STRING for production code"
+#endif
+
 #if SCM_COMPAT_SIOD
 #undef SCM_USE_NONSTD_FEATURES
 #define SCM_USE_NONSTD_FEATURES 1

Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c	2006-01-10 11:51:22 UTC (rev 2880)
+++ branches/r5rs/sigscheme/operations.c	2006-01-10 12:16:37 UTC (rev 2881)
@@ -1510,6 +1510,8 @@
             ch = SCM_CHARCODEC_READ_CHAR(scm_current_char_codec, mbs);
         } else {
 #if SCM_USE_NULL_CAPABLE_STRING
+            /* CAUTION: this code may crash when (scm_current_char_codec !=
+             * orig_codec) */
             ch = '\0';
             c_str = &SCM_MBS_GET_STR(mbs)[1];
             SCM_MBS_INIT2(mbs, c_str, strlen(c_str));



More information about the uim-commit mailing list