From: Peter Griess Date: Fri, 22 Mar 2013 15:12:30 +0000 (-0700) Subject: Enable Elf::at only for POD data types X-Git-Tag: v0.22.0~1027 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d7050ad5481a1a6dc958816655a4535cd2fd2df2;p=folly.git Enable Elf::at only for POD data types Summary: - Make sure that the utility function Elf::at only works for POD datatypes, as it uses reinterpret_cast. Test Plan: - Unit tests Reviewed By: simpkins@fb.com FB internal diff: D748314 --- diff --git a/folly/experimental/symbolizer/Elf.h b/folly/experimental/symbolizer/Elf.h index 88eae5e3..91f587c2 100644 --- a/folly/experimental/symbolizer/Elf.h +++ b/folly/experimental/symbolizer/Elf.h @@ -123,7 +123,8 @@ class ElfFile { void validateStringTable(const ElfW(Shdr)& stringTable) const; template - const T& at(off_t offset) const { + const typename std::enable_if::value, T>::type& + at(off_t offset) const { return *reinterpret_cast(file_ + offset); }