Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. diff --git a/hphp/runtime/vm/unit-inl.h b/hphp/runtime/vm/unit-inl.h
  2. index a678af3..5ce8ef6 100644
  3. --- a/hphp/runtime/vm/unit-inl.h
  4. +++ b/hphp/runtime/vm/unit-inl.h
  5. @@ -48,20 +48,24 @@ inline void SourceLoc::setLoc(const Location* l) {
  6. inline bool SourceLoc::same(const SourceLoc* l) const {
  7. return (this == l) ||
  8. (line0 == l->line0 && char0 == l->char0 &&
  9. line1 == l->line1 && char1 == l->char1);
  10. }
  11.  
  12. inline bool SourceLoc::operator==(const SourceLoc& l) const {
  13. return same(&l);
  14. }
  15.  
  16. +inline bool SourceLoc::operator!=(const SourceLoc& l) const {
  17. + return !same(&l);
  18. +}
  19. +
  20. ///////////////////////////////////////////////////////////////////////////////
  21. // Location tables.
  22.  
  23. template<typename T>
  24. Offset TableEntry<T>::pastOffset() const {
  25. return m_pastOffset;
  26. }
  27.  
  28. template<typename T>
  29. T TableEntry<T>::val() const {
  30. diff --git a/hphp/runtime/vm/unit.cpp b/hphp/runtime/vm/unit.cpp
  31. index 3a4edb5..51206c9 100644
  32. --- a/hphp/runtime/vm/unit.cpp
  33. +++ b/hphp/runtime/vm/unit.cpp
  34. @@ -599,21 +599,21 @@ Class* Unit::defClass(const PreClass* preClass,
  35. if (auto current = nameList->getCachedTypeAlias()) {
  36. FrameRestore fr(preClass);
  37. raise_error("Cannot declare class with the same name (%s) as an "
  38. "existing type", current->name->data());
  39. return nullptr;
  40. }
  41.  
  42. // If there was already a class declared with DefClass, check if
  43. // it's compatible.
  44. if (Class* cls = nameList->getCachedClass()) {
  45. - if (cls->preClass() != preClass) {
  46. + if (cls->preClass() != preClass) { // This?
  47. if (failIsFatal) {
  48. FrameRestore fr(preClass);
  49. raise_error("Class already declared: %s", preClass->name()->data());
  50. }
  51. return nullptr;
  52. }
  53. return cls;
  54. }
  55.  
  56. // Get a compatible Class, and add it to the list of defined classes.
  57. diff --git a/hphp/runtime/vm/unit.h b/hphp/runtime/vm/unit.h
  58. index 0b86083..61eab83 100644
  59. --- a/hphp/runtime/vm/unit.h
  60. +++ b/hphp/runtime/vm/unit.h
  61. @@ -84,20 +84,21 @@ struct SourceLoc {
  62. /*
  63. * Set to a parser Location.
  64. */
  65. void setLoc(const Location* l);
  66.  
  67. /*
  68. * Equality.
  69. */
  70. bool same(const SourceLoc* l) const;
  71. bool operator==(const SourceLoc& l) const;
  72. + bool operator!=(const SourceLoc& l) const;
  73.  
  74. /*
  75. * Start and end lines and characters.
  76. *
  77. * The default {1, 1, 1, 1} is an invalid sentinel value.
  78. */
  79. int line0{1};
  80. int char0{1};
  81. int line1{1};
  82. int char1{1};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement