mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-02 08:52:45 +01: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) {
|
getNetOptionValue(type) {
|
||||||
|
if ( this.nodeTypeRegister.includes(type) === false ) { return ''; }
|
||||||
const optionNode = this.nodeTypeLookupTable[type];
|
const optionNode = this.nodeTypeLookupTable[type];
|
||||||
if ( optionNode === 0 ) { return ''; }
|
if ( optionNode === 0 ) { return ''; }
|
||||||
const valueNode = this.findDescendantByType(optionNode, NODE_TYPE_NET_OPTION_VALUE);
|
const valueNode = this.findDescendantByType(optionNode, NODE_TYPE_NET_OPTION_VALUE);
|
||||||
|
@ -3336,15 +3336,16 @@ class FilterCompiler {
|
|||||||
this.processMethodOption(parser.getNetOptionValue(id));
|
this.processMethodOption(parser.getNetOptionValue(id));
|
||||||
this.optionUnitBits |= this.METHOD_BIT;
|
this.optionUnitBits |= this.METHOD_BIT;
|
||||||
break;
|
break;
|
||||||
case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECT:
|
case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECT: {
|
||||||
if ( this.action === AllowAction ) {
|
const actualId = this.action === AllowAction
|
||||||
id = sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE;
|
? sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE
|
||||||
}
|
: id;
|
||||||
if ( this.processModifierOption(id, parser.getNetOptionValue(id)) === false ) {
|
if ( this.processModifierOption(actualId, parser.getNetOptionValue(id)) === false ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.optionUnitBits |= this.REDIRECT_BIT;
|
this.optionUnitBits |= this.REDIRECT_BIT;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE:
|
case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE:
|
||||||
if ( this.processModifierOption(id, parser.getNetOptionValue(id)) === false ) {
|
if ( this.processModifierOption(id, parser.getNetOptionValue(id)) === false ) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user