Bytecode MEX: fix bug introduced in 8c01912a50
Use an iterator wrapped inside std::optional instead of a possibly-singular iterator, because the latter has undefined behaviour. By the way, pass arguments by const reference.mr#2067
parent
dc224e71ed
commit
9d84048710
|
@ -29,6 +29,7 @@
|
|||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <stack>
|
||||
#include <optional>
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <cmath>
|
||||
|
||||
|
@ -407,7 +408,7 @@ protected:
|
|||
corresponding mathematical operator will be printed within braces.
|
||||
The second output argument points to the tag past the expression. */
|
||||
pair<string, it_code_type>
|
||||
print_expression(it_code_type expr_begin, it_code_type faulty_op = {}) const
|
||||
print_expression(const it_code_type &expr_begin, const optional<it_code_type> &faulty_op = nullopt) const
|
||||
{
|
||||
int var, lag{0}, eq;
|
||||
UnaryOpcode op1;
|
||||
|
|
Loading…
Reference in New Issue