title: Floating point exception when storing something into unordered_map
body: <p>I'm using <code>unordered_map</code> as a hashmap in C++, but whenever I try to store anything in there, I get:</p>
  
  <p><code>Floating point exception: 8</code></p>
  
  <p>Can anyone point out what the error is? The following is how I initialized my map (<code>table_entry</code> is just a struct):</p>
  
  <p><code>std::tr1::unordered_map&lt;unsigned short, table_entry*&gt; forwarding_table;</code></p>
  
  <p>Then I was putting an entry in by doing:</p>
  
  <pre><code>unsigned short dest_id = 0;    
  table_entry *entry = (table_entry *)malloc(sizeof(table_entry));   
  forwarding_table[dest_id] = entry;
  </code></pre>
  
  <p>My struct's definition is:</p>
  
  <pre><code>typedef struct table_entry {
      unsigned short next_hop;
      unsigned int cost;
  } table_entry;
  </code></pre>
  
  <p>In terms of my compiler version, when I run <code>g++ -v</code> I get this: </p>
  
  <p><code>Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
  Thread model: posix
  gcc version 4.2.1</code></p>