Im not a tax lawyer or accountant but I don't see the IRS getting involved here either, nor it raising red flags, unless this went on for greater than a year. A W2 doesnt indicate the dates you worked for an employer, though the stock vesting would indicate overlap. Not sure about California tax forms though.
Maybe not illegal from a tax point of view but illegal as hell for someone on a H1B visa (which quite a significant number of employees in these companies have).
Could an H1B holder sneak past second company's HR/Legal and the filings?