diff --git a/libitm/ChangeLog b/libitm/ChangeLog index 1be02b525b4..9a3e484fc8a 100644 --- a/libitm/ChangeLog +++ b/libitm/ChangeLog @@ -1,3 +1,8 @@ +2012-03-05 Torvald Riegel + + * dispatch.h (CREATE_DISPATCH_METHODS_MEM): Don't execute + memtransfer/memset if size isn't larger than zero. + 2012-03-02 Torvald Riegel * libitm.texi: Link to specification and add a usage example. diff --git a/libitm/dispatch.h b/libitm/dispatch.h index d059c493507..6a9e62ef6c0 100644 --- a/libitm/dispatch.h +++ b/libitm/dispatch.h @@ -102,11 +102,13 @@ virtual void memtransfer(void *dst, const void* src, size_t size, \ bool may_overlap, ls_modifier dst_mod, ls_modifier src_mod) \ { \ - memtransfer_static(dst, src, size, may_overlap, dst_mod, src_mod); \ + if (size > 0) \ + memtransfer_static(dst, src, size, may_overlap, dst_mod, src_mod); \ } \ virtual void memset(void *dst, int c, size_t size, ls_modifier mod) \ { \ - memset_static(dst, c, size, mod); \ + if (size > 0) \ + memset_static(dst, c, size, mod); \ } #define CREATE_DISPATCH_METHODS_MEM_PV() \