aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtwebkit/0011-Offlineasm-warnings-with-newer-Ruby-versions.patch
blob: 1c810be57ccc9172012db9c4a0173f0e2bd33d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 3d3a5974ff31e55651bb0c47278bd15734d60be4 Mon Sep 17 00:00:00 2001
From: Adrian Perez de Castro <aperez@igalia.com>
Date: Wed, 15 Jan 2020 22:15:38 +0000
Subject: [PATCH] Offlineasm warnings with newer Ruby versions

https://bugs.webkit.org/show_bug.cgi?id=206233

Reviewed by Yusuke Suzuki.

Avoid a warning about using Object#=~ on Annotation instances, which
has been deprecated in Ruby 2.7.

* offlineasm/parser.rb: Swap checks to prevent applying the =~ operator
to Annotation instances, which do not define it.

Canonical link: https://commits.webkit.org/219400@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Upstream-Status: Backport
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 Source/JavaScriptCore/offlineasm/parser.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Source/JavaScriptCore/offlineasm/parser.rb b/Source/JavaScriptCore/offlineasm/parser.rb
index b44511245..cd1cffaec 100644
--- a/Source/JavaScriptCore/offlineasm/parser.rb
+++ b/Source/JavaScriptCore/offlineasm/parser.rb
@@ -584,9 +584,7 @@ class Parser
         firstCodeOrigin = @tokens[@idx].codeOrigin
         list = []
         loop {
-            if (@idx == @tokens.length and not final) or (final and @tokens[@idx] =~ final)
-                break
-            elsif @tokens[@idx].is_a? Annotation
+            if @tokens[@idx].is_a? Annotation
                 # This is the only place where we can encounter a global
                 # annotation, and hence need to be able to distinguish between
                 # them.
@@ -600,6 +598,8 @@ class Parser
                 list << Instruction.new(codeOrigin, annotationOpcode, [], @tokens[@idx].string)
                 @annotation = nil
                 @idx += 2 # Consume the newline as well.
+            elsif (@idx == @tokens.length and not final) or (final and @tokens[@idx] =~ final)
+                break
             elsif @tokens[@idx] == "\n"
                 # ignore
                 @idx += 1