summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-13 12:33:13 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-13 12:33:13 +0000
commit2f551849c4e05c96569739d8f057a4ea41e33300 (patch)
treeb8f72758501d5fec20755a8de36c6a478c0902ef /iseq.c
parenteaba77154f179446b838437cd0cb6f4be04523df (diff)
Use PRIuSIZE format specifier for size_t values
Use PRIuSIZE instead of PRIdSIZE. This fixes the exception message shown on too large xmalloc2. This commit also fixes other incorrect use of PRIdSIZE in other functions; though most of them are debug print. * gc.c (heap_extend_pages, get_envparam_size, ruby_malloc_size_overflow, gc_profile_dump_on): Use PRIuSIZE instead of PRIdSIZE as the passed value is size_t, not ssize_t. * iseq.c (get_line_info, rb_iseq_disasm_insn): Ditto. * sprintf.c (rb_str_format): Ditto. * thread_win32.c (native_thread_create): Ditto. * vm.c (get_param): Ditto. * ext/objspace/objspace_dump.c (dump_append_string_content, dump_object): Ditto. * ext/socket/raddrinfo.c (host_str, port_str): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/iseq.c b/iseq.c
index b6b31c052f..1e4656bc62 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1176,8 +1176,8 @@ get_line_info(const rb_iseq_t *iseq, size_t pos)
const int debug = 0;
if (debug) {
- printf("size: %"PRIdSIZE"\n", size);
- printf("table[%"PRIdSIZE"]: position: %d, line: %d, pos: %"PRIdSIZE"\n",
+ printf("size: %"PRIuSIZE"\n", size);
+ printf("table[%"PRIuSIZE"]: position: %d, line: %d, pos: %"PRIuSIZE"\n",
i, table[i].position, table[i].line_no, pos);
}
@@ -1189,7 +1189,7 @@ get_line_info(const rb_iseq_t *iseq, size_t pos)
}
else {
for (i=1; i<size; i++) {
- if (debug) printf("table[%"PRIdSIZE"]: position: %d, line: %d, pos: %"PRIdSIZE"\n",
+ if (debug) printf("table[%"PRIuSIZE"]: position: %d, line: %d, pos: %"PRIuSIZE"\n",
i, table[i].position, table[i].line_no, pos);
if (table[i].position == pos) {
@@ -1397,10 +1397,10 @@ rb_iseq_disasm_insn(VALUE ret, const VALUE *code, size_t pos,
insn_name_buff = insn_name(insn);
if (1) {
- rb_str_catf(str, "%04"PRIdSIZE" %-16s ", pos, insn_name_buff);
+ rb_str_catf(str, "%04"PRIuSIZE" %-16s ", pos, insn_name_buff);
}
else {
- rb_str_catf(str, "%04"PRIdSIZE" %-16.*s ", pos,
+ rb_str_catf(str, "%04"PRIuSIZE" %-16.*s ", pos,
(int)strcspn(insn_name_buff, "_"), insn_name_buff);
}