diff options
author | William Cohen <wcohen@redhat.com> | 2009-03-13 23:13:06 -0400 |
---|---|---|
committer | William Cohen <wcohen@redhat.com> | 2009-03-13 23:13:06 -0400 |
commit | 468cdbf127c55b3202d9d71dc2ebda481cec563b (patch) | |
tree | 9a8727bae29784c2c964423d582679a65e582349 /runtime/loc2c-runtime.h | |
parent | 354c462465ffc80fc9a55beb9d6066cfa6048bc1 (diff) | |
parent | 436b47f678c2fc5397ed66a1eddf6b419cc6585b (diff) | |
download | systemtap-steved-468cdbf127c55b3202d9d71dc2ebda481cec563b.tar.gz systemtap-steved-468cdbf127c55b3202d9d71dc2ebda481cec563b.tar.xz systemtap-steved-468cdbf127c55b3202d9d71dc2ebda481cec563b.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/loc2c-runtime.h')
-rw-r--r-- | runtime/loc2c-runtime.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h index 0af19edc..92c017d3 100644 --- a/runtime/loc2c-runtime.h +++ b/runtime/loc2c-runtime.h @@ -187,22 +187,22 @@ #define kread(ptr) ({ \ typeof(*(ptr)) _v; \ - if (probe_kernel_read((void *)&_v, (void *)(ptr), sizeof(*(ptr)))) \ - DEREF_FAULT(ptr); \ + if (lookup_bad_addr((unsigned long)(ptr)) || \ + probe_kernel_read((void *)&_v, (void *)(ptr), sizeof(*(ptr)))) \ + DEREF_FAULT(ptr); \ _v; \ }) #define kwrite(ptr, value) ({ \ typeof(*(ptr)) _v; \ _v = (typeof(*(ptr)))(value); \ - if (probe_kernel_write((void *)(ptr), (void *)&_v, sizeof(*(ptr)))) \ - STORE_DEREF_FAULT(ptr); \ + if (lookup_bad_addr((unsigned long)addr) || \ + probe_kernel_write((void *)(ptr), (void *)&_v, sizeof(*(ptr)))) \ + STORE_DEREF_FAULT(ptr); \ }) #define deref(size, addr) ({ \ intptr_t _i; \ - if (lookup_bad_addr((unsigned long)addr)) \ - __deref_bad(); \ switch (size) { \ case 1: _i = kread((u8 *)(addr)); break; \ case 2: _i = kread((u16 *)(addr)); break; \ @@ -215,8 +215,6 @@ }) #define store_deref(size, addr, value) ({ \ - if (lookup_bad_addr((unsigned long)addr)) \ - __store_deref_bad(); \ switch (size) { \ case 1: kwrite((u8 *)(addr), (value)); break; \ case 2: kwrite((u16 *)(addr), (value)); break; \ |