[llvm-dev] [GSoC'16] Weekly Status - July 3 - Zhengyang Liu

Zhengyang Liu via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 3 04:12:30 PDT 2016


Dear LLVM and SVA community:

This is to brief you the progress of this week. Following is what I finished this week.

1. Correct the free() call insertion mistake in PromoteArrayAllocas. This piece of code seems pretty robust now and works well. I have also added detailed comments for each function as you told me. This patch can be found in [1]

2. The getenv() call causes the generated program crash. This is because the return value of getenv() is not aligned, and SAFECode will treat getenv() as a memory allocation and register it.  I have also noticed strdup() call is the same as getenv().  Therefore, I created a wrapper function for getenv() and strdup(). This patch can be found in

3. Fix a bug in GEPChecks pass. The GEPChecks pass is introduced to automatically insert the safety checks to the getelementptr. Before the bugfix, GEPChecks pass can only handle getelementptr instructions with scalar return value. However, according to the LLVM Language Reference,the getelementptr returns a vector of pointers, instead of a single address, when one or more of its arguments is a vector.

<result> = getelementptr <ty>, <ptr vector> <ptrval>, <vector index type> <idx>

Therefore, I make the GEPChecks pass support this vector style getelementptr instruction.


Best regards,

Zhengyang.


[1] https://github.com/zhengyangl/safecode-llvm37/commit/ae3cb915609a5aa3feb53ea46e565481071acd07

[2] https://github.com/zhengyangl/safecode-llvm37/commit/2e114fb90eaf22523703e29aa5d8bbbd6f853b2c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160703/4dd9a8f9/attachment.html>


More information about the llvm-dev mailing list