The root.left line original post is equivalent to

root.left = buildTreeInPost(postStart-(inIndex-inStart)-1, inStart, inIndex-1, postorder, inorder);

and the correct one (which is in the comment) is equivalent to

root.left = buildTreeInPost(postStart-(inEnd-inIndex)-1, inStart, inIndex-1, postorder, inorder);

Reason: for postorder, we should use inEnd as reference.

we can also demonstrate this with an example in link http://articles.leetcode.com/2011/04/construct-binary-tree-from-inorder-and-preorder-postorder-traversal.html.

Inorder: 4,10,3,1,7,11,8,2

postorder: 4,1,3,10,11,8,2,7

Using the wrong root.left line, the left and right node of root is 3 and 2. Using the correct root.left line, the left and right node of root is 10 and 2.