mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-05 18:49:39 +02:00
Fix severe regression causing infinite loop in new parser
Related feedback: - https://www.reddit.com/r/uBlockOrigin/comments/10l2jjr/help_latest_ubo_developer_version_is_not_working/ - https://github.com/uBlockOrigin/uBlock-issues/issues/2469
This commit is contained in:
parent
b3f9a87ed8
commit
c600cbbd3a
@ -1489,6 +1489,7 @@ export class AstFilterParser {
|
||||
}
|
||||
|
||||
getNetOptionValue(type) {
|
||||
if ( this.nodeTypeRegister.includes(type) === false ) { return ''; }
|
||||
const optionNode = this.nodeTypeLookupTable[type];
|
||||
if ( optionNode === 0 ) { return ''; }
|
||||
const valueNode = this.findDescendantByType(optionNode, NODE_TYPE_NET_OPTION_VALUE);
|
||||
|
@ -3336,15 +3336,16 @@ class FilterCompiler {
|
||||
this.processMethodOption(parser.getNetOptionValue(id));
|
||||
this.optionUnitBits |= this.METHOD_BIT;
|
||||
break;
|
||||
case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECT:
|
||||
if ( this.action === AllowAction ) {
|
||||
id = sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE;
|
||||
}
|
||||
if ( this.processModifierOption(id, parser.getNetOptionValue(id)) === false ) {
|
||||
case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECT: {
|
||||
const actualId = this.action === AllowAction
|
||||
? sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE
|
||||
: id;
|
||||
if ( this.processModifierOption(actualId, parser.getNetOptionValue(id)) === false ) {
|
||||
return false;
|
||||
}
|
||||
this.optionUnitBits |= this.REDIRECT_BIT;
|
||||
break;
|
||||
}
|
||||
case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE:
|
||||
if ( this.processModifierOption(id, parser.getNetOptionValue(id)) === false ) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user