Replace our only dynamic_cast with old-school casting

dynamic_cast requires rtti to be enabled. Now, this isn't a big
problem, but since this is our only dynamic_cast in the entire
codebase, and it's not serving an important function, we can just
replace it.

See #7764
This commit is contained in:
Fabian Homborg 2021-03-02 09:43:21 +01:00
parent d655d24148
commit abaa057e5c

View file

@ -445,7 +445,9 @@ static std::unique_ptr<output_stream_t> create_output_stream_for_builtin(
// Our IO redirection is to an internal buffer, e.g. a command substitution.
// We will write directly to it.
std::shared_ptr<io_buffer_t> buffer =
dynamic_cast<const io_bufferfill_t *>(io.get())->buffer();
// (this is not a dynamic_cast because that needs rtti,
// and we currently use it nowhere else)
((const io_bufferfill_t *)io.get())->buffer();
return make_unique<buffered_output_stream_t>(buffer);
}