
20 Cal.2d 612 (1942)
Estate of WILLIAM J. BROAD, Deceased. SECURITY-FIRST NATIONAL BANK OF LOS ANGELES (a National Banking Corporation), as Executor, etc., Petitioner and Respondent,
v.
WILLIAM BROAD, Contestant and Respondent; R. F. PIERCE et al., Appellants.
L. A. No. 17945. 
Supreme Court of California. In Bank.  
July 29, 1942.
 Duckworth, Mussell & King for Appellants.
 Fred A. Wilson and Walter J. Hartzell for Respondents.
 Garret W. McEnerney, as Amicus Curiae, on behalf of Respondents. *614
 SHENK, J.
 This is an appeal from a judgment on a petition of the executor for the interpretation of the will of the decedent.
 The controversy involves the construction and application of section 41 of the Probate Code as amended in 1937 (Stats. 1937, p. 1435). That section provides: "No estate, real or personal, may be bequeathed or devised to any charitable or benevolent society or corporation, or to any person or persons in trust for charitable uses, by a testator who leaves a spouse, brother, sister, nephew, niece, descendant or ancestor surviving him, who, under the will, or the laws of succession, would otherwise have taken the property so bequeathed or devised, unless the will was duly executed at least thirty days before the death of the testator. If so executed at least thirty days before the death, such devices [sic] and legacies shall be valid, but they may not collectively exceed one-third of the testator's estate as against his spouse, brother, sister, nephew, niece, descendant or ancestor, who would otherwise, as aforesaid, have taken the excess over one-third, and if they do, a pro rata deduction from such devises and legacies shall be made so as to reduce the aggregate thereof to one-third of the estate. All property bequeathed or devised contrary to the provisions of this section shall go to the spouse, brother, sister, nephew, niece, descendant or ancestor of the testator, if and to the extent that they would have taken said property as aforesaid but for such devises or legacies; otherwise the testator's estate shall go in accordance with his will and such devises and legacies shall be unaffected."
 William J. Broad executed his last will and testament on April 8, 1939. He died three days later. By his will he forgave to his friends, Arthur and Florence Brock, their indebtedness to him, with the exception of the sum of $6,000. The $6,000 owed by the Brocks he bequeathed in equal shares to Grace Methodist Church, Redlands, California, and David and Margaret's Home, La Verne, California. He forgave his friends, R. F. and Alberta Pierce, the indebtedness owed by them and in addition bequeathed to them "all money remaining in my estate after payment of my indebtedness and the cost and expenses of administering my estate."
 The only other provision of the will which requires mention is the bequest of "all of the rest, residue and remainder" of the estate in equal shares to twelve named legatees, including the Pierces, Grace Methodist Church of Redlands, David and *615 Margaret's Home of La Verne, and Volunteers of America.
 The decedent left no spouse, brother, sister, descendant or ancestor surviving him but did leave several nieces and nephews, none of whom was named in the will with the possible exception of Martha Broad Berry who was designated therein as a cousin. The appraised value of the estate was $28,331.49. After the expiration of six months from the first publication of notice to creditors the Security-First National Bank of Los Angeles, named in the will as executor, filed a first account current, together with a petition for partial distribution and a petition for interpretation of the will. R. F. and Alberta Pierce filed an answer to the petition for interpretation and objections to the account and petition for distribution. William Broad, a nephew of the decedent, also filed an answer.
 By their answer the Pierces sought to have the court interpret the will so as to authorize distribution to them of all moneys remaining at the time of final distribution, including all assets which could be converted into cash, after payment of specific bequests and costs of administration.
 The answer of William Broad set forth a claim of sole heirship as a nephew of the testator; that as sole heir he would be entitled to have distributed to him the bequests and devises to the three charitable institutions, and that the Pierces would be entitled only to the portion of the money on hand at the date of death which remained after payment of indebtedness and the cost of administering the estate. After a hearing on the petition and answers the court found that the decedent left as his heirs at law three nephews and five nieces, descendants of a deceased brother and a deceased sister; that Grace Methodist Church of Redlands, David and Margaret's Home of La Verne, and Volunteers of America were charitable institutions within the meaning of section 41 of the Probate Code and were not exempt from its provisions ( 42 Prob. Code). The court determined that by reason of the death of the decedent within thirty days after executing his will and the survival of the nieces and nephews, the specific and residuary bequests to the three named charitable institutions were invalid, and that the property thereby bequeathed should be distributed to the nieces and nephews in accordance with the laws of succession. [1a] The court further concluded that the Pierces were entitled under the specific bequest to receive only the portion of cash on hand at the date of the death of *616 the testator which remained after the payment of indebtedness and the cost of administering the estate, exclusive of the expenses of maintaining the estate during the period of administration. Judgment was entered that the named nieces and nephews would be entitled to take in designated proportions the property bequeathed to the charitable institutions, namely, the $6,000 owed by the Brocks and three-twelfths of the residue.
 The Pierces have appealed from the judgment. It is their contention that the charitable bequests should devolve to them under the specific bequest of moneys on hand; or that the $6,000 bequest should fall into the residue and become distributable to all the residuary legatees including themselves, with the exception of the charitable legatees, and that the portion of the residue otherwise distributable to the charitable institutions should be distributed to the surviving heirs at law.
 [2] Preliminary to a discussion of the merits we note that the judgment was properly appealable as one determining the persons to whom distribution should be made ( 1240, Prob. Code). The court and the parties treated the proceeding as one for that purpose. The question raised by amicus curiae whether the judgment appealed from would be conclusive on persons not appearing or not represented in the proceedings, or whether such persons would be precluded on final distribution from asserting rights to a distributive share not in accordance with the court's adjudication, is not a question which need be determined on this appeal, especially in the absence of an objection by the appellants, and no such objection was made by them. [1b] There is no merit in the appellants' contention that the court erred in its conclusion that the legacy of money was limited as ordered in the judgment. The language of the legacy provision, read and considered with the other provisions for specific and residuary bequests, fully supports the court's construction of the specific legacy.
 [3a] The principal question for determination is the correctness of the court's interpretation and application of section 41 of the Probate Code. That section was founded on former section 1313 of the Civil Code. As originally enacted section 1313 declared void any bequest or devise for charity contained in a will executed within thirty days of the testator's death, or any disposition to charity of more than one-third of the estate by a testator leaving heirs at law. By express *617 provision the property involved in any such void bequest went "to the residuary legatee, or devisee, next of kin or heirs according to law." In Estate of Russell, 150 Cal. 604 [89 P. 345], it was held that under that section and section 1332 of the Civil Code (now  126, Prob. Code), the property mentioned in such a void legacy passed to the residuary devisee and not to the heirs unless a contrary intention appeared in the will.
 In Estate of Dwyer, 159 Cal. 680, 689 [115 P. 242], it was stated that the legislative restriction on bequests to charity was not intended as a mortmain statute or as declaratory of any public policy relative to charitable dispositions by will, but that its purpose was to protect the heirs at law against hasty and improvident gifts by the testator of his entire estate to charity and to the exclusion of those who in the judgment of the Legislature had a better claim to his bounty.
 In 1933 the matter of the Estate of Garthwaite, 131 Cal.App. 321 [21 P.2d 465], was decided. There the testatrix left no heirs. She executed a will within thirty days preceeding her death whereby she left her entire estate in trust for charitable uses. The sole question was whether that disposition was void under section 1313 of the Civil Code (reenacted in 1931 as section 41 of the Probate Code). It was contended that since the testatrix left no heirs the bequests should be deemed valid. It was held, however, that the testamentary disposition was void under the plain language of the statute. In 1937 the Legislature amended section 41 to read as first above quoted. Subsequently the matter of the Estate of Mautner, 38 Cal.App.2d 521 [101 P.2d 520], was decided. The facts were similar to those involved in the Garthwaite case. In accordance with the amended statute an order distributing property to a charitable organization was affirmed.
 It is the contention of the appellants and of amicus curiae that the purpose of the 1937 amendment was only to obviate the result declared in the Garthwaite estate and to produce the result declared in the Mautner estate, namely, that when there is surviving no spouse, brother, sister, nephew, niece, descendant, or ancestor, the restrictions of section 41 do not apply and the property should go in accordance with the will, but that when such heirs do survive, property bequeathed in excess of the restrictions passes into the residue by virtue of section 126 of the Probate Code and the decision in Estate of Russell, supra. In other words a construction is urged which *618 would be in accordance with the language as it read prior to the amendment of 1937, that all dispositions contrary to the restrictions "shall be void and go to the residuary legatees or devisees or heirs, according to law." The amended section does not invalidate the bequest or devise to charitable uses. It provides that "all property bequeathed or devised contrary to the provisions of this section shall go to the spouse, brother, sister, nephew, niece, descendant or ancestor of the testator if and to the extent that they would have taken said property as aforesaid but for such devises or legacies; otherwise the testator's estate shall go in accordance with his will and such devises and legacies shall be unaffected."
 [4] Such a material change in the wording of the section plainly indicates that the Legislature intended a change in the respects in which the previous language was amended. (People v. Weitzel, 201 Cal. 116, 118 [255 P. 792, 52 A.L.R. 811]; Loew's Inc. v. Byram, 11 Cal.2d 746, 750 [82 P.2d 1].) [3b] Undoubtedly the Legislature intended the change to accord with the result in the Mautner case, to the effect that the testamentary disposition should be unaffected where the testator did not leave any of the designated heirs. Also in accord with the obvious design to protect those heirs against "hasty and improvident gifts to charity" (Estate of Dwyer, supra), the Legislature provided that property bequeathed or devised contrary to the restrictions "shall go to the spouse," etc. Meaning must be given to the language thus employed. It was plainly intended that in that event such heirs should take. How they should take is then stated: "if and to the extent that they would have taken said property as aforesaid", that is "if" they "would otherwise have taken" said property "under the will or the laws of succession," and "to the extent" that they "would otherwise have taken" said property "under the will or the laws of succession." With this intention and purpose in mind we find no difficulty in concluding that the court was correct in determining that the surviving heirs should take under the laws of succession.
 The judgment is affirmed.
 Gibson, C.J., Curtis, J., and Carter, J., concurred.
 TRAYNOR, J.
 I dissent. The majority opinion assumes that the bequests to the charitable institutions were invalid *619 and that the problem resolves itself into determining whether the heirs or the residuary legatees should receive the property. There can be no question, however, as to whom such property shall go until it is first determined whether the gift to the charities is invalid. Section 41 of the Probate Code as amended in 1937 provides as follows: "No estate, real or personal, may be bequeathed or devised to any charitable or benevolent society or corporation, or to any person or persons in trust for charitable uses, by a testator who leaves a spouse, brother, sister, nephew, niece, descendant or ancestor surviving him, who, under the will, or the laws of succession, would otherwise have taken the property so bequeathed or devised, unless the will was duly executed at least thirty days before the death of the testator. If so executed at least thirty days before death, such devices [sic] and legacies shall be valid, but they may not collectively exceed one-third of the testator's estate as against his spouse, brother, sister, nephew, niece, descendant or ancestor, who would otherwise, as aforesaid, have taken the excess over one-third, and if they do, a pro rata deduction from such devises and legacies shall be made so as to reduce the aggregate thereof to one-third of the estate. All property bequeathed or devised contrary to the provisions of this section shall go to the spouse, brother, sister, nephew, niece, descendant or ancestor of the testator, if and to the extent that they would have taken said property as aforesaid but for such devises or legacies; otherwise the testator's estate shall go in accordance with his will and such devises and legacies shall be unaffected."
 A bequest to charity is invalid under this section only if, in addition to the death of the testator within thirty days after the execution of the will, the testator leaves surviving him designated heirs, "who under the will, or the laws of succession, would otherwise have taken the property so bequeathed." The death of the testator within the thirty-day period and the survival of the designated heirs are not alone sufficient to invalidate the bequest. There remains the question whether the named heirs would "otherwise" have taken the property under the will, or the laws of succession "but for such devises or legacies." In other words, if the charitable bequests had not been made, to whom would the property go under the will, or, if the will does not cover this contingency, to whom would the property go under the laws of succession? If the property would go to spouse, brother, sister, nephew, niece, *620 descendant or ancestor the bequest to charity is invalid. If it would not go to any of these but to more remote kin or strangers to the blood it is valid. The property cannot go to the designated heirs, and the charitable bequest is therefore valid if (a) the testator does not leave surviving him a nephew, niece or nearer heir (Estate of Mautner, 38 Cal.App.2d 521 [101 P.2d 520]; see Estate of Garthwaite, 131 Cal.App. 321 [21 P.2d 465] for the opposite rule before the 1937 amendment to section 41), or (b) if he has so framed his will that his nephews, nieces, or nearer heirs would not take what would otherwise be a defeated gift to charity.
 Under section 41 as it read before the 1937 amendment, a void charitable devise passed to the residuary devisee and not to the heirs, in the absence of a contrary provision in the will. (Estate of Russell, 150 Cal. 604 [89 P. 345].) The 1937 amendment to section 41 makes it plain that charitable bequests and devises are no longer to be sacrificed to the enrichment of residuary bequests or devises given to strangers to the blood or to heirs more remote than nephew and niece. That purpose is clearly set forth in section 41 as follows: "All property bequeathed or devised contrary to the provisions of this section shall go to the spouse, brother, sister, nephew, niece, descendant or ancestor of the testator, if and to the extent that they would have taken said property as aforesaid but for such devises or legacies; otherwise the testator's estate shall go in accordance with his will and such devises and legacies shall be unaffected." The same result is accomplished by that portion of section 42 reading as follows: "Bequests and devises ... made by a testator leaving no spouse, brother, sister, nephew, niece, descendant or ancestor surviving by whom the property so bequeathed or devised would have been taken if said property had not been so bequeathed or devised, are excepted from the restrictions of this article." If none of the designated heirs can take the property, the restrictions on charitable bequests do not apply and the property goes in accordance with the testator's will. The very reasons therefore that exclude the heirs make a charitable bequest valid as against residuary legatees.
 In the present case the decedent left nieces and nephews surviving him. The validity of the charitable bequests therefore depends upon whether the property would go to such heirs but for those bequests. If the residuary bequest to the charities had not been made there would be an intestacy as to one-fourth of the residue and the nieces and nephews would *621 inherit that property under the laws of succession. That bequest therefore is invalid, and as property bequeathed contrary to the provisions of section 41, it must go to the nieces and nephews. If the specific bequest had not been made the $6,000 would be included in the residue under Probate Code, section 126, for it is not otherwise bequeathed by the testator's will. The will contains a residuary clause, which does not include the nieces and nephews and they are not otherwise provided for in the will. It is clear therefore that the nieces and nephews cannot take such property under the will. Had there been no residuary clause they would have taken under the laws of succession and the specific bequest would therefore have been invalid. Since there is a residuary clause, however, they can take under the laws of succession only to the extent that the residuary bequests are not effective. The residuary clause left one-fourth of the residue to three charitable organizations, two of which were legatees of the $6,000 bequest. The residuary share of the charitable organization was therefore augmented by one-fourth of the $6,000 that would have gone to the other residuary legatees had the bequest to such organizations not been made. That one-fourth cannot go to the other residuary legatees because it was not bequeathed to them. It cannot go to the charitable organizations because there are heirs who would have taken under the laws of succession had it not been bequeathed to the charity. One-fourth of the $6,000 should therefore go to the nieces and nephews under the express terms of section 41 that "All property bequeathed or devised contrary to the provisions of this section shall go to the ... nephew, niece ... of the testator if and to the extent that they would have taken said property but for such devises or legacies."
 The remaining three-fourths of the $6,000 bequest is a valid gift to charity by reason of the following express terms of section 41: "... otherwise the testator's estate shall go in accordance with his will and such ... legacies shall be unaffected" and section 42: "Bequests ... made by a testator leaving no ... nephew, niece ... surviving by whom the property so bequeathed ... would have been taken if said property had not been so bequeathed ... are excepted from the restrictions of this article."
 It is immaterial that the charities may benefit by a reversal of the judgment although they are not appellants in *622 this proceeding. If the part of a judgment appealed from is so dependent upon the remainder that it affects the whole, the appeal is from the entire judgment, and the appellate court must do as justice requires. (Estate of Murphey, 7 Cal.2d 712 [62 P.2d 374]; Whalen v. Smith, 163 Cal. 360 [125 P. 904, Ann. Cas. 1913E, 1319].) The present appeal cannot be limited to the determination in favor of the heirs, for that determination is dependent upon the holding that the gifts to charity are void. Furthermore, proceedings to determine to whom distribution shall be made are in rem and no judgment in personam is given in favor of one party against another. (Edlund v. Superior Court, 209 Cal. 690 [289 P. 841]. See, also, O'Day v. Superior Court, 18 Cal.2d 540 [116 P.2d 621]; Lilienkamp v. Superior Court, 14 Cal.2d 293 [93 P.2d 1008].) The object of the proceedings is to ascertain the persons entitled to share in the estate, and in the words of the Edlund case, "It will not be questioned that justice and sound policy require that the estates of decedents be distributed to persons rightfully entitled thereto. ..."
 The judgment should be reversed.
 Edmonds, J., concurred.
