[compiler-rt] r269882 - [LSAN] Fix test swapcontext.cc on MIPS

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 07:39:39 PDT 2016


Sagar,

I have a comment on your change...


On 18 May 2016 at 07:09, Sagar Thakur via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: slthakur
> Date: Wed May 18 01:09:26 2016
> New Revision: 269882
>
> URL: http://llvm.org/viewvc/llvm-project?rev=269882&view=rev
> Log:
> [LSAN] Fix test swapcontext.cc on MIPS

(...)


> Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h?rev=269882&r1=269881&r2=269882&view=diff
> ==============================================================================
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h Wed May 18 01:09:26 2016
> @@ -110,6 +110,11 @@ struct BufferedStackTrace : public Stack
>    void operator=(const BufferedStackTrace &);
>  };
>
> +// Check if given pointer points into allocated stack area.
> +static inline bool IsValidFrame(uptr frame, uptr stack_top, uptr stack_bottom) {
> +  return frame > stack_bottom && frame < stack_top - 2 * sizeof (uhwptr);
> +}
> +

This is not a template function, why can't you have its declaration on
the header file and leave the implementation in the C file?

cheers,
--renato


More information about the llvm-commits mailing list