[pypy-commit] pypy vmprof2: use -1 as a special value

fijal noreply at buildbot.pypy.org
Sun Apr 19 15:02:47 CEST 2015


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: vmprof2
Changeset: r76832:680ec700b161
Date: 2015-04-19 15:02 +0200
http://bitbucket.org/pypy/pypy/changeset/680ec700b161/

Log:	use -1 as a special value

diff --git a/pypy/module/_vmprof/src/get_custom_offset.c b/pypy/module/_vmprof/src/get_custom_offset.c
--- a/pypy/module/_vmprof/src/get_custom_offset.c
+++ b/pypy/module/_vmprof/src/get_custom_offset.c
@@ -43,7 +43,7 @@
     start = n;
     while (n < max_depth) {
         id = pypy_yield_codemap_at_addr(codemap, addr, &current_pos);
-        if (id == 0)
+        if (id == -1)
             // finish
             break;
         result[n++] = (void *)id;
diff --git a/rpython/jit/backend/llsupport/codemap.py b/rpython/jit/backend/llsupport/codemap.py
--- a/rpython/jit/backend/llsupport/codemap.py
+++ b/rpython/jit/backend/llsupport/codemap.py
@@ -132,7 +132,7 @@
     res = []
     while True:
         item = yield_bytecode_at_addr(codemap_raw, addr, storage)
-        if item == 0:
+        if item == -1:
             break
         res.append(item)
     lltype.free(storage, flavor='raw')
diff --git a/rpython/jit/backend/llsupport/src/codemap.c b/rpython/jit/backend/llsupport/src/codemap.c
--- a/rpython/jit/backend/llsupport/src/codemap.c
+++ b/rpython/jit/backend/llsupport/src/codemap.c
@@ -115,10 +115,10 @@
 
     while (1) {
         if (current_pos >= data->bytecode_info_size)
-            return 0;
+            return -1;
         next_start = data->bytecode_info[current_pos + 1];
         if (next_start > rel_addr)
-            return 0;
+            return -1;
         next_stop = data->bytecode_info[current_pos + 2];
         if (next_stop > rel_addr) {
             *current_pos_addr = current_pos + 4;


More information about the pypy-commit mailing list