0007-Offlineasm-warnings-with-newer-Ruby-versions-https-b.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 47e03d4af292805bf304f09e34333b38a94c1789 Mon Sep 17 00:00:00 2001
  2. From: "aperez@igalia.com" <aperez@igalia.com>
  3. Date: Wed, 15 Jan 2020 22:15:38 +0000
  4. Subject: [PATCH] Offlineasm warnings with newer Ruby versions
  5. https://bugs.webkit.org/show_bug.cgi?id=206233
  6. Reviewed by Yusuke Suzuki.
  7. Avoid a warning about using Object#=~ on Annotation instances, which
  8. has been deprecated in Ruby 2.7.
  9. * offlineasm/parser.rb: Swap checks to prevent applying the =~ operator
  10. to Annotation instances, which do not define it.
  11. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@254637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  12. Upstream: https://github.com/WebKit/WebKit/commit/c7d19a492d97f9282a546831beb918e03315f6ef
  13. Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
  14. ---
  15. Source/JavaScriptCore/offlineasm/parser.rb | 6 +++---
  16. 1 file changed, 3 insertions(+), 3 deletions(-)
  17. diff --git a/Source/JavaScriptCore/offlineasm/parser.rb b/Source/JavaScriptCore/offlineasm/parser.rb
  18. index b4451124521f..cd1cffaec6ed 100644
  19. --- a/Source/JavaScriptCore/offlineasm/parser.rb
  20. +++ b/Source/JavaScriptCore/offlineasm/parser.rb
  21. @@ -584,9 +584,7 @@ class Parser
  22. firstCodeOrigin = @tokens[@idx].codeOrigin
  23. list = []
  24. loop {
  25. - if (@idx == @tokens.length and not final) or (final and @tokens[@idx] =~ final)
  26. - break
  27. - elsif @tokens[@idx].is_a? Annotation
  28. + if @tokens[@idx].is_a? Annotation
  29. # This is the only place where we can encounter a global
  30. # annotation, and hence need to be able to distinguish between
  31. # them.
  32. @@ -600,6 +598,8 @@ class Parser
  33. list << Instruction.new(codeOrigin, annotationOpcode, [], @tokens[@idx].string)
  34. @annotation = nil
  35. @idx += 2 # Consume the newline as well.
  36. + elsif (@idx == @tokens.length and not final) or (final and @tokens[@idx] =~ final)
  37. + break
  38. elsif @tokens[@idx] == "\n"
  39. # ignore
  40. @idx += 1
  41. --
  42. 2.43.1