aboutsummaryrefslogtreecommitdiff
path: root/fesvr/device.cc
AgeCommit message (Collapse)AuthorFilesLines
2022-10-04Suppress several unused-parameter warnings in fesvrAndrew Waterman1-1/+1
2022-03-17Don't respond to invalid HTIF operations with assertion failuresAndrew Waterman1-1/+0
They should cause bad behavior in target land rather than crashing the simulator.
2021-08-26fesvr: replace use of `std::vector::operator[0]`Saleem Abdulrasool1-4/+4
This replaces multiple uses of `std::vector::operator[]` where the parameter is a constant `0` with the use of C++11's `std::vector::data` method. This fixes the root cause of invalid memory accesses. `std::vector::operator[]` is an unchecked memory access, and when the buffers are zero-sized (that is the buffer container is empty) either due to a 0 padding in the case of elfloader or NULL parameters to syscalls where permitted, the unchecked access may cause an invalid memory access. The use of `std::vector::data` is permitted even in such a case, though the returned memory may not be dereferenced. The general usage of the returned pointer is to pass to `memif_t`, which is careful about 0-sized buffer accesses, and so passing the result of `std::vector::data` is safe. This is theoretically a better access pattern as it also avoids having the compiler to re-materialize the pointer from the de-referenced location.
2019-03-31Add fesvr; only globally install fesvr headers/libsstatic-linkAndrew Waterman1-0/+155