vadimcn added inline comments.

================
Comment at: lldb/trunk/scripts/Python/python-typemaps.swig:481
+  PyBuffer_Release(&view);
+  $1 = ($1_ltype) buf;
+  $2 = ($2_ltype) (size/sizeof($*1_type));
----------------
Sorry for being late to the party, but I just stumbled upon this code...  

It seems to return a pointer from a view that had just been released.  Isn't 
this kind of risky?   While most of the time buffer views point into object's 
internal memory, buffer protocol does not prohibit allocating memory just to 
fulfill the buffer request.  In which case PyBuffer_Release would be expected 
to release that memory, leaving the caller with a dangling pointer.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67793/new/

https://reviews.llvm.org/D67793



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to