Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.10',
'v8_embedder_string': '-node.11',

##### V8 defaults for Node.js #####

Expand Down
8 changes: 8 additions & 0 deletions deps/v8/src/regexp/regexp-compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ Compiler::CompilationResult Compiler::Assemble(
work_list.pop_back();
node->set_on_work_list(false);
if (!node->label()->is_bound()) {
set_flags(item.flags);
if (node->Emit(this, &new_trace).IsError()) {
work_list_ = nullptr;
return ReportError();
Expand Down Expand Up @@ -2461,6 +2462,7 @@ EmitResult AssertionNode::EmitBoundaryCheck(Compiler* compiler, Trace* trace) {
}
bool at_boundary = (assertion_type_ == AssertionNode::AT_BOUNDARY);
if (next_is_word_character == Trace::UNKNOWN) {
const Flags flags = compiler->flags();
NonAssertingLabel before_non_word(compiler);
NonAssertingLabel before_word(compiler);
if (trace->characters_preloaded() != 1) {
Expand All @@ -2475,6 +2477,7 @@ EmitResult AssertionNode::EmitBoundaryCheck(Compiler* compiler, Trace* trace) {
at_boundary ? kIsNonWord : kIsWord));
assembler->GoTo(&ok);

compiler->set_flags(flags);
assembler->Bind(&before_word);
RETURN_IF_ERROR(BacktrackIfPrevious(compiler, trace,
at_boundary ? kIsWord : kIsNonWord));
Expand Down Expand Up @@ -6258,8 +6261,13 @@ class Analysis : public NodeVisitor {
}

void VisitChoice(ChoiceNode* that) override {
// Flags need to be reset to the state of the ChoiceNode at the beginning
// of each alternative, as flags might be modified when visiting an
// alternative.
Flags header_flags = flags();
for (int i = 0; i < that->alternatives()->length(); i++) {
EnsureAnalyzed(that->alternatives()->at(i).node());
set_flags(header_flags);
if (has_failed()) return;
STATIC_FOR_EACH(Propagators::VisitChoice(that, i));
}
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/src/regexp/regexp-compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,13 @@ class V8_EXPORT_PRIVATE Compiler {

struct WorkItem {
Node* node;
Flags flags;
};

inline void AddWork(Node* node) {
if (!node->on_work_list() && !node->label()->is_bound()) {
node->set_on_work_list(true);
work_list_->push_back({node});
work_list_->push_back({node, flags()});
}
}

Expand Down